Name: pedrorod Date: May 1, 2008 at 11:05:31 Pacific Subject: Batch Script Help OS: Windows XP CPU/Ram: 3ghz Model/Manufacturer: Dell
Comment:
I am new to batch scripting and need some help. Here is what I wish to do.
Users will download a folder and run a batch script that will call some executables which reference some files. The problem I have is that different users will download the folder to different locations. Hhow do I go about making the batch script run the executables from the current folder no matter where the folder has been saved by the users?
You shouldn't have to do anything special. It should just work, as long as the batch script does not make any assumptions about the absolute location of the folder. I.e. don't run a file as C:\Programs\prog.exe, just run prog.exe and it will be taken from the current folder.
pedrorod, M2 is providing good help so I won't confuse you by adding any more info, but I'd just like to clarify something mainly for M2's benefit:
When you run a program by typing its name without a path, it doesn't just look for it in the PATH. It first looks in the current directory, and only looks in the PATH if it doesn't find it in the current directory. Note that this differs from how it's done on Unix.
The information on Computing.Net is the opinions of its users. Such
opinions may not be accurate and they are to be used at your own risk.
Computing.Net cannot verify the validity of the statements made on this site. Computing.Net and Computing.Net, LLC hereby disclaim all responsibility and liability for the content of Computing.Net and its accuracy.
PLEASE READ THE FULL DISCLAIMER AND LEGAL TERMS BY CLICKING HERE