How to work CMD?
CMD is a command interface that like MS DOS and running on Windows operating systems. Your can run your programs using this command line interface.
You can run files by writing the path to the file and the file name. For example you want to run a file called 'my.exe' which is located in 'c:\', type c:\my.exe on the command prompt to run my.exe.
But how to work CHKDSK and other commands in Command prompt without the path.
Because of, CHKDSK is a file which located in c:\windows\system32 folder. And system32 folder is given to the environment variable as a path. So you don't want to type the path to the system32 folder, you can run it by typing the file name.
In some computers this path is not correctly defiled, so you can't run the programs by only tying the name of the file. To fix this problem you have to add the path to the path variable of the system variables. And also, if you want to set other your own path(you need to set path to the java compiler if you working javac with command prompt.) in this way.
Setting Paths to Windows Environment Variable.
To set path variable you can use this way.
Right click on My Computer and select Properties
Select the Advanced System Settings(Only if your computer windows vista or newer)
Go to Advanced tab
Click on Environment Variables button
There is a Variable under System variables(in the table), select it and click Edit button.
Be careful, Don't Delete existing values in the Variable value.
You can see the first value for the path variable is %SystemRoot%\system32;
This means system32 folder which is in your windows installed location(by default c:\windows)
If you can't run windows programs like CHKDSK using the command prompt, you must add this value. And remember that you must type ;(semicolon) separating each value.
If you want to and your custom location, type the path and then a semicolon.
This is the way to configure your CMD for system32 or anywhere you want to run programs without typing the whole path to that file.



No comments:
Post a Comment