Using "start" in command prompt


  1. Posts : 7
    Windows 7 Ultimate x64
       #1

    Using "start" in command prompt


    Hello

    I understand what the %path% and %pathext% variables are.

    typing: "notepad" or "calc" in the command prompt from any directory will open notepad.exe and calc.exe because their directories are in %path% and ".exe" is in %pathext%.

    On the other hand "wordpad.exe" and "chrome.exe are not in %path% so typing "wordpad" or "chrome" from a random directory doesn't work.

    however, typing "start wordpad" or "start chrome" does work. How come? How does the start command know where to find the executables?

    Thanks in advance!
      My Computer


  2. Posts : 10,200
    MS Windows 7 Ultimate SP1 64-bit
       #2

    I don't have chrome installed but I do have wordpad installed and I can simply type Wordpad, hit enter and Wordpad starts.
      My Computer


  3. Posts : 5,056
    Windows 7 x64 pro/ Windows 7 x86 Pro/ XP SP3 x86
       #3

    Wordpad is very much located in the path (C:\windows\system32\write.exe), thats why it opens from the run box.
      My Computer


  4. Posts : 7
    Windows 7 Ultimate x64
    Thread Starter
       #4

    Typing write works
    Typing wordpad doesn't work (seems to work for karlsnooks)
    Typing "start wordpad" works! My question is how come.

    I figured it out. When you use the start command, in addition to looking in the %path% it looks at all file types.

    For example if I type "ftype" in the command line, I get:

    ChromeHTML="C:\Users\Ralph\AppData\Local\Google\Chrome\Application\chrome.exe" -- "%1"
    ...
    Wordpad.Document.1="%ProgramFiles%\Windows NT\Accessories\WORDPAD.EXE" "%1"

    I tested out other programs to confirm:
    "start iexplore"
    "start winamp"
      My Computer


  5. Posts : 6,285
    Windows 10 Pro X64
       #5

    As long as there is a subkey for the program under this registry key, it can be launched from the Run box.

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

    This is not true from a Command Prompt.Try this from the run box or a Command Prompt (all on one line):

    cmd /c reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths" /s > app_paths.txt & notepad app_paths.txt & del app_paths.txt


    Notepad will open with the contents of that registry key then delete the file when you close notepad.
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 01:34.
Find Us