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

  • What exactly is your question? Why do you find it odd exactly that %TMP% works? – Ramhound Sep 21 '14 at 12:38
  • in Run window TEMP & %TEMP% & %TMP% works! but TMP doesn't work! why? (all of them are environment variables) – kokabi Sep 21 '14 at 15:48
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.

  • very thank's PetSerAl! unfortunately i don't have enough Reputation to vote up you. thank's again! – kokabi Sep 21 '14 at 17:05
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

  • thanks but question is other thing, i edit my question please read it again. – kokabi Sep 21 '14 at 16:28
  • I will edit my answer to reflect your new question, it will be in the PS section, Thanks – Larry Hyman Sep 22 '14 at 1:16
  • 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 Sep 22 '14 at 5:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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