Sign up ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Suppose I have a program named any_program.exe and my operating system drive is C:. The location of the program is D:\Any_Folder\any_program.exe

How do I start/execute that program via command prompt in Windows 8?

I have tried the command line START any_program.exe, but it shows me an error that

Windows cannot find 'any_program.exe'. Make sure you typed the name correctly, and then try again.

By the way, it worked perfectly in Windows 7. And, if I type START notepad.exe or START firefox.exe (Firefox is not installed in C: drive), it works in Windows 8.

share|improve this question
This doesn't really have anything to do with Windows 8 in particular, does it? – Joey Oct 28 '12 at 17:37
I guess it does. In windows 7, only the path would have worked. But in windows 8, the path of the program must be in between quotation marks (what I've found out), or it shows error that it could not locate the program (if the path isn't registered in PATH environment variable or in App registry). – Ahmadul Hoq Oct 29 '12 at 11:08
@AhmadulHoq Windows 7 does behave in exactly the same way, as far as I know. You probably had the file in one of those places. – Bob Oct 31 '12 at 3:33

6 Answers 6

up vote 13 down vote accepted

There are three basic ways to run a 'command' in the Command Prompt.

  • builtins ("internal commands")

    These are commands built into cmd itself, and do not require an external program invocation. They also do not perform any searching, and will always be executed with the highest priority if matched. You can bypass builtins by wrapping the executable name in quotes: echo calls the builtin, but "echo" would search following cmd rules.

  • Direct invocation

    This is when you directly specify a program name (without a path). For example, if you run cmd (cmd.exe) or ipconfig (ipconfig.exe) at the prompt, you are directly calling the external command. This performs limited searching implemented entirely within the Command Prompt, in this order:

    • The current directory.
    • The directories that are listed in the PATH environment variable.

    (thanks to dxiv for the comments)

  • Through the start command

    When you try to execute a file through the start command, Command Prompt does not perform any searching. Instead, it passes the file name (and arguments) over to Windows itself (via the ShellExecuteEx API call), which must then search for the file's location. There are several places it searches in the following order:

    • Current working directory
    • Windows directory
    • Windows\System32 directory
    • Directories listed in PATH environment variable
    • Registry defined App Paths

    Note that the Run dialog also uses this search method.

Normally, you can either navigate to the location of the file with cd /d D:\Any_Folder (/d means change drive) and just run any_program.exe. Alternatively, you can specify the full path D:\Any_Folder\any_program.exe.

If you want to start it with start any_program.exe, you have a couple of options:

  • You can put it in the Windows or System32 directories, or any directory in the PATH environment variable.
  • You can add the directory it is located in (D:\Any_Folder) to the PATH environment variable, see this question for details.
  • You can add it to the App Paths registry key, as Notepad and Firefox does. App Paths links a file keyword (such as firefox.exe) with the full path to the file, unlike the other options that deal with directories. See here for more information.
share|improve this answer
For completeness, it should be noted that running a program at the command prompt directly as any_program.exe does not search the App Paths key, while running it as start any_program.exe does e.g. on a default Win7 install, entering wordpad at the prompt gives a not recognized error, while start wordpad successfully launches wordpad (based on its App Paths key). Technical reason is that the linked page refers to ShellExecuteEx (which start uses) while CreateProcess (which direct execution uses) specifically mentions that App Paths is not searched. – dxiv yesterday
Thanks, that was quick for a 3-years late comment ;-) The relevant docs-link is but I didn't have room to include it in the previous comment. The search logic is listed in #1-6 under lpCommandLine. – dxiv yesterday
@dxiv Thanks for the link. I've also edited that in, though it doesn't seem to match my observed behaviour... (try: set path= followed by cmd can't find it, but start cmd works as it still searches paths outside the env var). – Bob yesterday
Thanks for doublechecking. It is indeed the case that cmd direct execution doesn't search the windows/system directories by default, and I was wrong to point to the CreateProcess docs. Seems that cmd has its own logic, per the "Command Search Sequence" section under… dating back to at least NT times, and most likely forever before. – dxiv yesterday
@dxiv Thanks, updated with the new link. – Bob yesterday
start D:\Any_Folder\any_program.exe

or, when path or file contains spaces

start "" "D:\Any_Folder\any_program.exe"

start any_program.exe works only for those programs, who are located in %PATH% environment variable, or registered in registry in the key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths or its HKEY_CURRENT_USER analogue.

share|improve this answer

You have two options:

  1. Add the program to your %PATH% variable
  2. Use quotes in your shortcut


Adding any_program.exe to path:

  1. Go to "Control Panel" ->"Advanced System Settings"
    Advanced System Settings
  2. Go to the Advanced tab
    System Settings

  3. Click on "Environment Variables" Add the folder in which any_program.exe resides. Edit the PATH Variable and add the folder in the end, separated by a ;
    path variable

  4. You can now use any_program.exe in the run dialog box (Try logging out and back to make sure your path variable changes are used.)

Using complete path

Instead of using any_program.exe in the Run dialog, you need to use the complete PATH. So type D:\Stuff\App\any_program.exe in the run dialog instead.

share|improve this answer
those screenshots are WAAAY to large. Mind having them at a reasonable size? – Journeyman Geek Oct 28 '12 at 9:30
Working on it... – Abhay Rana Oct 28 '12 at 9:34
Path directories on Windows are delimited by semicolons (;), not colons (:)... – Bob Oct 28 '12 at 9:39
I had that in my mind, but still mis-typed it. – Abhay Rana Oct 28 '12 at 9:42
Screenshots taken from… apparently . The screenshots there are terrible – Journeyman Geek Oct 28 '12 at 9:52
  1. Open Command Prompt
  2. Type the name of the program you want to run. If its on the PATH System variable it will be executed. If not, you'll have to type the full path to the program. For example, to run D:\Any_Folder\any_program.exe type D:\Any_Folder\any_program.exe on the Command prompt and press Enter
share|improve this answer
Haha nice trick! – Ahmadul Hoq May 1 '13 at 7:41

I am using a yet simple method . . .
Copy the shortcut of the file to C:\users\name and then type the shortcut's name in run dialog box. . . . .

share|improve this answer

I guess you have to add the path to the PATH variable in system variables

share|improve this answer

Your Answer


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.