Hi,
In order to run a program from the command line, the computer goes
through a number of steps to see if it can find it. First it starts in
the directory you are in, when you typed the command. You can check to
see if your batch file is in this directory by typing "dir" without
the quotes. In fact, any time I give you a command within quotes,
don't use the quotes, just the command.
The next place the computer checks is your PATH, which is a list of
directories given to the computer as 'okay to look at' and if computer
finds the program in one of those directories it will run it as well.
You can get a list of the directories in your PATH by typing in the
command "path".
If the program or batch file you are trying to run is not in your
current directory, or in a directory inside your PATH list, then the
computer will not be able to find the batch file, and will not be able
to run it.
Use your Find (Start->Search->Files or Folders) utility to find your
batch file. Then write down the directory it is in. It is very likely
that in order to run correctly that the batch file needs to be in the
directory you found it in, so don't move it.
Next open your Command Prompt window, and change the directory to the
directory you found the script in. So if you found the script in
C:\utils\programs\batch you would type in "cd c:\utils\programs\batch"
and then type in the name of the batch file, and it should run. "cd"
is the command to change directories.
You can also run the batch file by using the full path and the name at
the end, but with batch files, this is not usually a good idea, unless
they were written very well. Your current directory is still the same
when you do this, and most of the time batch files are just quick
utils for a specific job, and if you were going to spend a great deal
of time putting in error checking and things, you would probably use a
different method, and not a batch script (this is just from past
experience, I've seen some very well done batch files in the past as
well, but not often).
Jan's Computer Basics
http://www.jegsworks.com/Lessons/reference/doscommands.htm
DOS TUTORIAL : THE BASICS
http://www.glue.umd.edu/~nsw/ench250/dostutor.htm
DOS Batch File Tutorial
http://www.chebucto.ns.ca/~ak621/DOS/BatBasic.html
Search Terms
DOS Command Basics
DOS batch file Basics
thanks,
webadept-ga |