How to add custom user variables to Windows to load folders faster
This guide explains how to set up custom variables in Windows that you can use to open or reference folders faster.
Windows makes use of several preconfigured variables like %tmp% or %userprofile% that you can use when you are Windows Explorer, on the command line, and anywhere else on the system.
What many Windows users do not know that it is possible to add custom variables easily to the system as well, so that you can open folders faster or save time when you are referencing them as you do not need to type that much.
To test how those variables work, open Windows Explorer and type %tmp% in the address bar of the file explorer. You should be take to the temporary file folder of the user account you are logged in.
Some common variable names that exist by default in Windows are the following ones (assuming that Windows is installed on C:, that the username is Martin, and that the operating system is Windows 7. Directories may differ depending on the version of Windows).
- %ALLUSERSPROFILE% opens C:\ProgramData
- %APPDATA% loads c:\Users\Martin\AppData\Roaming
- %PROGRAMFILES% loads "c:\program files"
- %USERPROFILE% opens c:\Users\Martin\
- %TEMP% displays the contents of C:\Users\Martin\AppData\Local\Temp
- %WINDIR% loads c:\windows
To set up your own custom variables, do the following
- Open the System control panel. Probably the easiest way to do so is to press Windows-Pause on your keyboard.
- Locate the advanced system settings link and click on it. This opens the system properties window.
- Click on the environment variables button.
- Here you find listed user variables and system variables.
- Click on new underneath user variables.
- Add a name for the variable, e.g. music, images, videos, code or anything else that you want to later use to open or reference the folder.
- Add the full path as the variable value. If the path has a space in it, enclose it in quotation marks. Valid examples are d:\mp3 or "d:\mp3 collection", but not d:\mp3 collection.
- You can add as many variables as you like.
- Once you are done, click on ok and restart the PC.
Once Windows has started again, open Windows Explorer and test the new variables that you have just added to your system.you need to enclose the name with % to indicate that it is a variable, e.g. %music% or %code%.
If something is not working properly, repeat the steps above but instead of adding a new variable, edit the one that is not working.
You can use those variables in many different situations, from loading the folder quickly in Windows Explorer to combining it with file names on the command line and using it in programs.
I always do this for the Desktop folder .:)
This can be done programmatically using the SETX command (with /M for system variables)
You do do this with RapidEE and save yourself the typing.