Different Execution the TEMP Variable and TMP in run window

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

kokabi

Posted 2014-09-21T12:35:12.527

Reputation: 113

What exactly is your question? Why do you find it odd exactly that %TMP% works? – Ramhound – 2014-09-21T12:38:51.593

in Run window TEMP & %TEMP% & %TMP% works! but TMP doesn't work! why? (all of them are environment variables) – kokabi – 2014-09-21T15:48:05.220

Answers

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

Posted 2014-09-21T12:35:12.527

Reputation: 2 679

very thank's PetSerAl! unfortunately i don't have enough Reputation to vote up you. thank's again! – kokabi – 2014-09-21T17:05:13.057

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

Larry Hyman

Posted 2014-09-21T12:35:12.527

Reputation: 53

thanks but question is other thing, i edit my question please read it again. – kokabi – 2014-09-21T16:28:39.577

I will edit my answer to reflect your new question, it will be in the PS section, Thanks – Larry Hyman – 2014-09-22T01:16:05.563

thank you larry, i got the answer, according to first post image, TMP is Reserved too! (C:\windows\System). difference is that Temp Folder is exist in c:\windows\system and TMP no!, if i create TMP in C:\windows. TMP will run too. also "c:\windows" by default is defined in Path environment variable. if i create any folder with any name in c:\windows, all of them will be running! anyway thank you for you effort! – kokabi – 2014-09-22T05:28:25.767