Last Updated: February 25, 2016
·
866
· hovanessb

Command Line Troubles

Often enough as coders we have to use the command line to run a .exe or script to start a project. Sometimes when following some tutorial we have trouble because we try to use the command line the exact same way the authors do. Something we often forget, especially in Windows, is changing to the directory where ever the .exe is actually located; then we are allowed to run the program or execute the script.

Picture

We can make this process faster and easier by being able to call the program from ANY folder location within the command line.

Picture

We do this by adding the folder path of the program to the Windows "Environmental List". Simply by adding the path location we are able to call the executable.

Picture

We can make any program executable, from anywhere, here I made Photoshop executable

Picture

After Saving the new settings I can run Photoshop from any location:

Picture

All major operating systems support this, look for a basic guide to add environmental variables, here is Windows and Mac OS:
Adding Environmental Variables for Windows 7 or 8
Mac OS X Setting Variables Question

More Info:
Microsoft
Wiki