Hello,
if you start your batch by double click, it will run in the current directory where the batch is on it.
your batch will find all proccesses and programs you start in batch with "program parameters ...",
or all relative Filenames - because they are present in this directory.
This corresponds to the command: "pushD directoryName" to set the work directory.
All relatively specified path and file names are then resolved.
Or in Variable "path" there is a reference to this directory, which is searched for the application
and executes the application when found.
if you start this batch as an administrator the current directory that work
this batch in it is: "%windir%\system32%", the application cant be found in
this directory if is not present in it or in "%path%".
The relative paths are no longer found or solved correctly.
in order to start this application from any directory, you must add this application directory
into the "Path" variable And use Pushd WorkingDir.
Note: if you start as an administrator an use: pushd "WorkingDirectory" (in qoutes)
it is useful to take a line like this one:
Code: Select all
if . == . pushd "working Directory"
Phil