C
corradolab
Hi,
if you start a batch file from Explorer the working directory is the
directory which holds the file.
If you start a batch file from a shortcut you can specify a different
one.
But if you start a batch file as Administrator the working directory
is always C:\Windows\System32, even if the file is in a different
directory or is started from a shortcut whit an explict working
directory.
This cause every batch file calling another executable (batch, exe,
ecc.) to fail if not using absolute paths.
The quickest workaround is probably to edit the batch file changing
the current directory.
Something like:
CD \my_directory
CALL another_batch_file
My question is: why?
Is there a reason because the working directory is not respected or is
simply a missing functionality?
Kind regards,
Corrado
if you start a batch file from Explorer the working directory is the
directory which holds the file.
If you start a batch file from a shortcut you can specify a different
one.
But if you start a batch file as Administrator the working directory
is always C:\Windows\System32, even if the file is in a different
directory or is started from a shortcut whit an explict working
directory.
This cause every batch file calling another executable (batch, exe,
ecc.) to fail if not using absolute paths.
The quickest workaround is probably to edit the batch file changing
the current directory.
Something like:
CD \my_directory
CALL another_batch_file
My question is: why?
Is there a reason because the working directory is not respected or is
simply a missing functionality?
Kind regards,
Corrado