Dignified userprofile. Windows Environment Variables - TEMP and TMP


Windows environment variables - the stress on "Y" in the second word (the meaning of the phrase is in the genitive case and the correct stress: variables of what? - environments!), In English versions of Windows - environment variable)

Windows environment variables are used to tune operating systems. Not every user needs to deal with these settings and get into these variables, but there are a couple of variables that all PC users need to know about. These are the variables responsible for the temporary storage of files - TEMP and TMP.



The default value for user-defined temporary (TEMP) variables is % USERPROFILE% \ Local Settings \ Temp,

The default value for system temporary variables is \ WINDOWS \ Temp.

Therefore, in the first case it is usually: " C: \ Documents and Settings \ USER \ Local Settings \ Temp"

Inexpensive productive Ultrabook:

Specifications: 14.1 inch 1920 * 1080 IPS screen, Windows 10, 8GB RAM, 256GB M.2 SATA 2280 SSD, Wifi, keyboard backlight.

Due to the fact that in the family of Windows operating systems folders with temporary files for some reason are not cleared by themselves, they can accumulate a huge number of various unnecessary files, reaching a total size of up to several gigabytes! Various viruses and bad scripts periodically hide among the temporary files, so it is the duty of every PC user to regularly delete the contents of temporary folders.

For ease of removal, it is better to change the default path to a simpler one, the best option is " C: \ Temp".

How to change Windows environment variables TEMP and TMP? - Very simple:

1. Right click on the " My computer"on the desktop (if this is a full-fledged icon, not a shortcut) or via the menu Start -> My Computer -> Properties:

2. Go to the " Additionally"and click on the button below" Environment Variables":

3. In the upper window " User environment variables"first select the first line (variable TEMP) and press the button" Change":



4. Correct the value of the variable to a simpler one - " C: \ Temp":

5. Repeat steps 3 and 4 for the variable TMP:

As a result, you should get:

6. Press alternately 2 times " OK".



In principle, the same can be done using the command line by running the command: SET TEMP = C: \ TEMP

All Windows environment variables:

ALLUSERSPROFILE Specifies the location of the All Users profile (local variable)
APPDATA Specifies the location of the directory where programs store data by default (local variable)
CD Specifies the name of the current directory (local variable)
CMDCMDLINE Specifies the command line parameters that were used to start the current instance of CMD.EXE (local variable)
CMDEXTVERSION Specifies the version number of the current shell extension (system variable)
COMPUTERNAME Specifies the computer name (system variable)
COMSPEC Specifies the exact path to the shell executable (system variable)
DATE Indicates the current date. The format is the same as for the date / t command. The value is generated by the shell (system variable)
ERRORLEVEL Indicates the error level code of the last program. A nonzero value most likely indicates an error (system variable)
HOMEDRIVE Specifies the drive letter of the local workstation connected to the home directory. The variable is determined based on the path to the home directory. The user's home directory is defined in the Local Users and Groups snap-in (system variable)
HOMEPATH Specifies the fully qualified path to the user's home directory. The variable is determined based on the path to the home directory. The user's home directory is defined in the Local Users and Groups snap-in (system variable)
HOMESHARE Specifies the network path to the user's shared home directory. The variable is determined based on the path to the home directory. The user's home directory is assigned in the Local Users and Groups snap-in (system variable)
LOGONSERVER Specifies the name of the domain controller on which the current session is authorized (local variable)
NUMBER_OF_PROCESSORS Indicates the number of processors installed on the computer (system variable)
OS Specifies the version of the operating system. Windows XP / XP OS are designated as Windows_NT (system variable)
PATH Specifies the search path for executable files (system variable)
PATHEXT Specifies a list of extensions that are recognized by the operating system as extensions for executable files (system variable)
PROCESSOR_ARCHITECTURE Indicates the type of processor architecture. Possible values: x86 and IA64 (system variable)
PROCESSOR_IDENTIFIER Specifies a description of the processor (system variable)
PROCESSOR_LEVEL Specifies the model number of the processor installed in the computer (system variable)
PROCESSOR_REVISION Specifies the version number of the processor model (system variable)
PROMPT Specifies the command line prompt options for the current interpreter. Generated by the CMD.EXE interpreter (local variable)
RandOM Specifies a random decimal number between 0 and 32767. Generated by CMD.EXE (system variable)
SYSTEMDRIVE Specifies the letter of the drive where the Windows root directory is located (system variable)
SYSTEMROOT Specifies the path to the Windows root directory (system variable)
TEMP or TMP Specifies the path to the default temporary directories. These directories are used by applications available to the registered user. Some applications require the value of the TEMP variable, while others require TMP (system and user variables respectively)
TIME Indicates the current time. The format is the same as for the time / t command. Generated by the CMD.EXE interpreter (system variable)
USERDOMAIN Specifies the name of the domain in which the user account is stored (local variable)
USERNAME Indicates the name of the user who is currently logged on to the system (local variable)
USERPROFILE Specifies the path to the profile of the current user (local variable)
WINDIR Specifies the path to the operating system directory (system variable)



To access the value of a variable, you need to put a% sign in front of its name and after it, for example: echo% NUMBER_OF_PROCESSORS%

If the .USERPROFILE file is known to your system, then you can open it by double clicking the mouse or pressing the ENTER key. This operation will start applications associated with the .USERPROFILE file installed on your system. If the system encounters the file for the first time and there are no corresponding associations, then the action will end with the system's offer to find the appropriate software on the computer or on the Internet.

Sometimes it happens that the files of the .USERPROFILE type a wrong program is assigned. This happens due to the action of hostile programs such as viruses or malware, but most often it is the result of an application mistakenly combining with the .USERPROFILE file extension. If, while serving a new file type .USERPROFILE, we point the system to the wrong program, the system will erroneously recommend its use whenever a file of this type is encountered. In this case, you should try again to select the appropriate application. Right-click on file.USERPROFILE, and then select from the menu the option "Open With ..." and "Choose default program". Now select one of the installed applications from the above list and try again.

Programs that will open the .USERPROFILE file

Manual editing of the Windows Registry

If our system cannot cope with the extension .USERPROFILE and all automatic and semi-automatic methods of teaching him this art have failed, all that remains is manual editing of the Windows registry. This registry stores all information related to the operation of our operating system, including the connection of file extensions with programs for their service. Command REGEDIT inscribed in the window "Search programs and files" or „Run in the case of older versions of the operating system, it provides us with access to the registry of our operating system. All operations performed in the registry (even not very complicated ones concerning the file extension .USERPROFILE) have a significant impact on the operation of our system, therefore, before making any modifications, you should make sure that a copy of the current registry is made. The section we're interested in is the key HKEY_CLASSES_ROOT... The following manual shows step by step how to modify the registry, specifically the entry in the registry that contains information about .USERPROFILE file.

Step by step

  • Click the "start" button
  • In the "Find programs and files" window (in older versions of Windows this is the "Run" window) enter the "regedit" command and then confirm the operation with the "ENTER" key. This operation will launch the system registry editor. This tool will allow you not only to view existing records, but also to modify them, add or delete them manually. Due to the fact that the registry of the Windows system is key to its operation, all operations carried out on it should be performed judiciously and deliberately. Careless removal or modification of an inappropriate key can permanently damage the operating system.
  • Use the ctr + F key combination or the Edit menu and the "Find" option to find the extension.USERPROFILE you are interested in by entering it in the search engine window. Confirm by pressing OK or by using the ENTER key.
  • Backup copy. It is extremely important to create a backup copy of the registry before making any changes to it. Every change has an impact on how our computer works. In extreme cases, mistakenly modifying the registry can make it impossible to restart the system.
  • The value you are interested in regarding the extension can be manually edited by changing the keys assigned to the found extension .USERPROFILE. Here you can also create your own entry with the .USERPROFILE extension if there is no such in the registry. All available options are located in the handy menu (right mouse button) or in the "Edit" menu after placing the cursor in the appropriate place on the screen.
  • After finishing editing an entry for the .USERPROFILE extension, close the system registry. The introduced changes will take effect after restarting the operating system.

Environment variables used in batch (command) files allow you to bypass the need for absolute directory paths. For example, if we do not know in advance the letter of the system drive, we can always use the variable % systemdrive%, which returns the letter of the drive on which the OS is installed. Also, variables are used to optimize the code - a repeatedly repeated parameter (for example, a registry key) can be assigned a short variable and used. This article discusses in detail the various techniques for working with variables, as well as how to modify and create new variables. Now let's talk about everything in order.

Classification of environment variables

Summary

The Windows Command Shell (cmd.exe) is a very powerful tool for working with the system. Batch files can automate a fair amount of tasks, which is why they are often used to automatically install Windows. Skillful use of variables in batch files allows you to solve a wide range of issues. Working with the shell becomes more efficient and at the same time, the code of batch files is simplified. You can find other examples of using variables on the website or forum pages. All examples used in this article are taken from the scripts of the participants, for which many thanks to them.

Terminology

Command shell Is a separate software product that provides direct communication between the user and the operating system. The CLI Text User Interface provides an environment in which text-based applications and utilities run.

cmd.exe- a command interpreter that the Windows command shell uses to translate the entered command into a format that the system understands.

Team session can be initiated as launch cmd.exe or by running a batch file. In other words, the current command shell is created. Accordingly, exiting this shell (for example, ending a batch file) ends the command session.

User session(user session) starts from the moment the user logs in (log on) and ends when the user logs off (log off).







2021 gtavrl.ru.