2

I am using Windows 7. There are two folders with the same name "Temp", I can open them in windows Run by typing temp and %temp% respectively.

When I see the path of these folders, it shows me both name as Temp.

For "Temp": C:\Windows\Temp

For "%Temp%": C:\Users\MySys\AppData\Local\Temp

What is the difference between them? Also, I want to know if we use % as prefix and suffix for Temp because it has naming clash with another Temp? Are these folders available in all Windows versions?

1
  • 1
    The percent signs mean "expand an environment variable", in this case an environment variable named TEMP that points to the temporary folder for your user account. It should be present in all Windows versions. The other folder is for operating system use only (well, more or less). Commented Sep 15, 2015 at 3:41

2 Answers 2

5

I got to know this now.

"Temp": C:\Windows\Temp is just a path to the Temp folder

"%Temp%": C:\Users\MySys\AppData\Local\Temp is the environmental variable which is pointing to Temp inside another folder.

%xxxx% is used as the shortcut to access environmental variables in Windows.

3

The two Temp folders mentioned are not same. First "Temp" folder is related to windows temporary data. The second "Temp" is a temporary folder which is used to store the application related data (Not operating system data). If you update any application (say firefox) the application is downloaded to this temp folder and then installed and then the setup file is deleted. It is just used as a garbage space for some application related activities.

The percent sign (%) represents zero, one, or multiple characters before and after the name. It will search for temp name regardless of the characters present before and after the temp name. Its like regular expression in SQL.

1
  • 1
    No, in this context the percent sign causes environment variable expansion. Commented Sep 15, 2015 at 3:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.