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.

Assume Microsoft Office is installed. Consider the following batch file:

REM the following line successfully launches Microsoft Word
start winword

REM none of the following commands work to launch Microsoft Word
winword
winword.exe
winword.com
winword.bat
winword.cmd
winword.vbs
winword.vbe
winword.js
winword.jse
winword.wsf
winword.wsh
winword.msc

What is it about the "start" cmd instruction that allows the launching of Microsoft Word using the name "winword"?

My curiosity stems from my interest in the mechanics of the "start" verb -- I don't need suggestions on other ways to start Microsoft Office. Please don't suggest that I add the Microsoft Office directory to my PATH environment variable -- I know what that would do. The question is: how is "start" finding "winword" when cmd cannot find it directly?

share|improve this question

3 Answers 3

up vote 7 down vote accepted

The App Paths key is evaluated just after PATH if I'm not mistaken:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\Winword.exe]
@="C:\\PROGRA~2\\MICROS~1\\Office14\\WINWORD.EXE"
"Path"="C:\\Program Files (x86)\\Microsoft Office\\Office14\\"
"useURL"="1"
"SaveURL"="1"

That's how both the Start command and the Run dialog recognise Winword.exe as a valid alias. For more, read How is it possible to run Wordpad by just typing its name even though it isn't on the PATH? by Raymond Chen.

share|improve this answer

It's just not the start, but also the "Run dialog". The secret?

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

Run dialog and start checks here too. The command line doesn't.

share|improve this answer

So, the Start method in cmd enables a user to start a SEPARATE window in Windows from the Windows command line. Without the ` method, cmd try to start/launch the defined resources, but without extension, he get it as a directory and so no effect...

Non-executable files may be invoked through their file association just by typing the name of the file as a command.

(e.g. WORD.DOC would launch the application associated with the .DOC file extension).

See the ASSOC and FTYPE commands for how to create these associations from within a command script.`

share|improve this answer

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.