1

Why does the environment variable "TEMP" work without a percent Sign in Run window, but "TMP" variable doesn't work? I know the "TMP" Variable works with "%TMP%" in Run window.

This is my Environment variable window configuration:

enter image description here

according to above picture in Run Window (win+R):

Temp --> open "C:\Windows\Temp"

%Temp% --> open "C:\Users\ADMINI~1\AppData\Local\Temp"

%TMP% --> open "C:\Users\ADMINI~1\AppData\Local\Temp"

TMP --> (doesn't open any folder while TMP similar to TEMP Defined in User variable Section)

As you can see %TEMP% and %TMP% when run, open value in user variable ( "C:\Users\ADMINI~1\AppData\Local\Temp" )

but when using TEMP (without percents sign), it opens system variable value ("C:\Windows\Temp").

i expect TMP similar to TEMP open "C:\windows\Temp" but doesn't work (is that a windows bug?)

Additionally, I have this folders on my system

Ayub
  • 113

2 Answers2

0

To make a long story short, "TMP" just tells windows that it is a folder called TMP but windows does not know where it is... you could have a folder on drive c:\ called "tmp" you would access it with "c:\tmp". Remember, "tmp" is not a RESERVED windows word (so you can use it for folder names)

but the " % " is special and reserved, just for this,

please see:

Is there a list of Windows special directories/shortcuts (like %TEMP%)?

PS: This is my new answer

Because "TEMP" is reserved for C:\Windows\temp

and TMP is not reserved

%temp% is reserved for C:\Users\User\AppData\Local\Temp

and

%tmp% is reserved for C:\Users\User\AppData\Local\Temp

Have a look here, I think it's to be compatible with some old Dos Programs that still run under windows XP and Windows 7 that need "TEMP" and not "%TEMP%"

https://stackoverflow.com/questions/581966/whats-the-difference-between-tmp-and-temp-in-vista-environment-variables

and

http://en.wikipedia.org/wiki/Environment_variable

Thanks

Larry Hyman

0

TEMP (without percent sign) is not refer to environment variable. It just a folder named Temp located in some path (C:\Windows) included in Path environment variable. You can do Win+R+Modules and it will open C:\Windows\System32\WindowsPowerShell\v1.0\Modules since C:\Windows\System32\WindowsPowerShell\v1.0\ in Path environment variable by default. If you create a forder named Tmp in any path included in Path environment variable it will be opened by Win+R+TMP.

user364455
  • 3,069