When a command has been issued on the run dialog box, Windows OS performs below actions

Windows Run dialog

  • Searches for the command/application under C:\Windows\System an C:\Windows\System32. If the application is available, it will be started. Else, it performs next action
  • Searches for the file under the location mentioned with global environment variable (System wide) "PATH". If found, executes else goes to next stepp
  • Searches for the file under the location mentioned with local evironment variable (Logged in user specific) "PATH". Executs if found, else raises an error saying that application can't be identified

Note: if user provides absolute path of the program or URL in the textbox, windows directly opens it i.e.; above operations will not be performed.

So, if you want to start your own program from Run dialog box, you should add the program path into "PATH" environment variable.

Adding environment variables

  • Open system properties (Right click on My computer, and choose "Properties")
  • Click on "Advanced" tab
  • Hit "Environment variables"
  • You will see another dialog which will display environment variables in two sections. The top section refers the environment variables defined for the current logged in user. 2nd section refers to system wide environment variables.
  • If you find PATH already in there, just click "Edit" and add your application folder at the end of the value after semi-colon (;)

Environment variables dialog