|
|
The PATH statement is used by DOS and Windows to determine where to look for programs. When you run a program from the command window (sometimes called the DOS window), DOS looks in the current folder for the program. If it can't find the program, it looks inside each folder listed in the PATH statement. If the program is not found in any of these folders, DOS displays the error message "Bad command or file name". This page describes how to change the PATH statement so DOS can find your programs no matter what directory you are currently in. If you are using Windows 2000 or XP
If you are using Windows 95-98(1) Find where the program is located on the hard drive.Let's
say you want to run the program named JAVADOC.EXE.
(2) View your current PATH to see if that directory is included.To view the current path, open up a command window (Start/Run/command) Type in "SET" at the DOS prompt. This will show all of the environment variables. Stay focused on the PATH statement and look for the directory your program is located in. Notice in this example that there is a listing for C:\JBuilder6\jdk1.3.1 . However, this won't work because the JAVADOC.EXE program is in the bin directory of this folder. Don't let the other variables bother you. Stay focused on the PATH statement.
(3) Modify the Autoexec.bat file to add to the PATHAn easy way to change the PATH statement is to use the SYSEDIT program (Start/Run/Sysedit). Be patient, it takes awhile on some systems to display. The
REM statement is a remark telling others what
the next line does. Please note: The name of the directory MUST be spelled correctly. Open up Windows Explorer and go to the file so you have a reference to look at as you type in the SYSEDIT program. When you close SYSEDIT it will ask you if you want to save. Answer YES. Very Important! After you save the file, you have to do a complete shut down. On some systems (Windows 2000), doing a warm boot will not cause the AUTOEXEC.BAT file to run and the changes you've made won't happen.
(4) Double check the PATH statement.Repeat step number 2 and look at the PATH statement:
You should be able to run the program once you see the correct directory in the PATH statement. To test your path, open up a command window (or use the current one) and type in just the program name. In this case, JAVADOC. You should see the program start and a long series of help statements showing what should go on the command line when you run this program. If the error messages still say that the file cannot be found, go back and double check the directory (step 1) as well as the spelling of the directory (step 2). **** The
CLASSPATH environment variable is not the same
as the PATH. |
|
|