Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Cmd.exe has the SET command that lists the all "%" constants, for example %USERNAME% , %ProgramFiles% or %CUSTOMDEFINEDCONSTANT%. However, after issuing the START firefox my browser immediately popped up, although neither firefox nor %firefox% had been mentioned!

Why there are two types of constants? For me, "Program's constant"(that I've rough-and-readily called it) seems to be redundant so far because START %programName% would be sufficient, doesn't it? I'm also asking about the counterpart of the SET command for this strange constants' type.

The question is elementary, but I decided to ask about it here due to the lack of a search coordinates or keywords.

share|improve this question
    
Those are Environment Variables. Also search for PATH, that is also an environment variable and explain why you can do START firefox. –  criziot Jul 21 '12 at 20:41
    
@criziot PATH | FINDSTR firefox yields no results. –  0x6B6F77616C74 Jul 21 '12 at 20:44
    
PATH has a list of directories containing binaries. When you try to execute a binary cmd will search for it in the directories specified in PATH. So firefox is not in PATH, but the directory containing the firefox binary must be. Also you should do echo $PATH to see the PATH. –  criziot Jul 21 '12 at 21:08
    
> Also you should do echo $PATH to see the PATH. You’re thinking of PowerShell; the OP is using cmd where there is actually a command called path that displays or sets the path. –  Synetech Jul 21 '12 at 21:32
    
@Synetech I'm not a Windows user so I wasn't aware of that. Thanks for the repair. –  criziot Jul 22 '12 at 1:42
add comment

1 Answer

up vote 4 down vote accepted

I believe that, among other things, it looks in this registry key for the executable name:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths

This key allows an application to register itself for execution without modifying the PATH variable. MSDN has more information about application registration.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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