How to add custom user variables to Windows to load folders faster - gHacks Tech News

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

windows user variables

To set up your own custom variables, do the following

  1. Open the System control panel. Probably the easiest way to do so is to press Windows-Pause on your keyboard.
  2. Locate the advanced system settings link and click on it. This opens the system properties window.
  3. Click on the environment variables button.
  4. Here you find listed user variables and system variables.
  5. Click on new underneath user variables.
  6. 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.
  7. 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.
  8. You can add as many variables as you like.
  9. 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.

Summary
How to add custom user variables to Windows to load folders faster
Article Name
How to add custom user variables to Windows to load folders faster
Description
How to set up custom variables in Windows to access folders faster.
Author

We need your help

Advertising revenue is falling fast across the Internet, and independently-run sites like Ghacks are hit hardest by it. The advertising model in its current form is coming to an end, and we have to find other ways to continue operating this site.

We are committed to keeping our content free and independent, which means no paywalls, no sponsored posts, no annoying ad formats or subscription fees.

If you like our content, and would like to help, please consider making a contribution:

Comments

  1. GK said on May 6, 2014 at 7:30 pm
    Reply

    I always do this for the Desktop folder .:)

  2. X said on May 6, 2014 at 11:36 pm
    Reply

    This can be done programmatically using the SETX command (with /M for system variables)

Leave a Reply

Check the box to consent to your data being stored in line with the guidelines set out in our privacy policy

Please note that your comment may not appear immediately after you post it.