Users can run an executable from windows command prompt either by giving the absolute path of the file or just by the executable file name. In the latter case, Windows searches for the executable in a list of folders which is configured in environment variables on the System. These environment variables are shown below.
The values of these variables can be checked in system properties (Run sysdm.cpl from Run or computer properties). Initially user specific path environment variable will be empty. Users can add paths of the directories having executables to this variable. Administrators can modify the system path environment variable also.
How to set path from command line?
In Vista, Windows 7 and Windows 8 we can set path from the command line using the ‘setx’ command.
setx path "%path%;c:\directoryPath"
For example, to add c:\dir1\dir2 to the path variable, we can run the below command.
setx path "%path%;c:\dir1\dir2"
Thanks for visiting mswintips.com.
Return to Index Page
Copyright ©2019 CSN All Rights Reserved