How Do I Tell Windows 8/Windows 8.1 to Run a Batch/Executable File without Typing Its Full Path in Run/Command Window?

As per Windows 8/Windows 8.1 default configuration, whenever you type the name of an application in the Run command box or in the command window, the application automatically initializes, and you do not have to type its full path. The benefit of this is that you do not even have to remember the path of the application, and you can initialize it just by typing its name.

This behavior of the operating system is because of the predefined locations that the Windows looks in as soon as you type the name of the required application (e.g. NOTEPAD.exe, MSPAINT, etc.) and hit the Enter key. Some predefined locations are C:\Windows\System32, C:\Program Files, etc. As you can notice that all the predefined locations are in the system drive (C: drive), if you want a batch file that is stored in a different location, maybe in a different drive (e.g. D:\), you must add its path to the predefined locations that Windows looks in order to check for the available executable file.

In order to do so, you must add the path to the system Environment Variables, and you can do so by following the instructions described below:

Note: Assuming that you have created a batch file and stored it in the D:\ drive, you must follow the step-by-step instructions to configure Windows 8/Windows 8.1 accordingly.

    ■Since you are about to modify the system environment variables, log on to Windows 8/Windows 8.1 computer using the administrator account.
    ■Click the Desktop tile from the Start screen.
    ■On the desktop window, click the File Explorer icon from the taskbar.
    ■On the opened This PC window, from the left pane, right-click the This PC tree.
    ■From the displayed context menu, click Properties.
    XmdzET8.jpg

    ■On the opened System window, from the left pane, click Advanced system settings.
    21vqrkj.jpg

    ■From the System Properties box that comes up, make sure that the Advanced tab is selected.
    ■From the displayed options, click the Environment Variables button from the bottom.
    oMiMx1k.jpg

    ■On the opened Environment Variables window, under the System variables section, click to select the Path system variable from the displayed list.

10. Once selected, click the Edit button.
z1FZlNx.jpg

11. From the Edit System Variables box, in the Variable value field, go to the end of the list by pressing the Home key on the keyboard after left-clicking inside the field.
12. Type the colon sign (;), and then type the new location where you want Windows 8/Windows 8.1 to look for the available applications/files. (D:\ in this example).
litKRw3.jpg

13. Finally, click OK to close the opened box.
14. Back on the Environment Variables box, click OK again, and close all the opened windows and boxes.
15. Once this is done, restart the computer in order to allow the changes to take effect.