It may certainly do this with a batch script that uses CMD.EXE.
It is possible that the problem also applies to ANY EXECUTABLE that may be similarly launched.
I have a third party explorer that launches CMD.EXE and gives it the name and path of the selected file.
If I double clicked then CMD.EXE has its home changed from its location, i.e.
C:\WINDOWS\system32
and is instead set to target the folder containing the script, so that a command
DEL *.EXE
will only zap the EXE files that are in the same folder as the script.
Unfortunately when launched via "RUN AS ..." there is no change to the home location.
In my case the script merely wanted to change a INI file that was a companion in the same folder as the script,
and instead CMD.EXE was trying to locate and change that file in Windows\system32. Bad Move.
I had to add this to my script before I could successfully use RUN AS ...
Code: Select all
CD /D %~dp0
You may wish test any third party "Windows Explorer" that you use to select and "RUN AS ..."
HARMLESS Test Code
Code: Select all
@ECHO OFF
ECHO %~0
CD
PAUSE
EXIT
My result of RUN AS with Windows Explorer :-
D:\_T\D3\Clean30\V\Y\Harmless.bat
D:\_T\D3\Clean30\V\Y
Press any key to continue . . .
My result of RUN AS with third party explorer :-
D:\_T\D3\Clean30\V\Y\Harmless.bat
C:\WINDOWS\system32
Press any key to continue . . .
I know that my version of Windows Explorer in Windows Home + SP3 has no such problem,
at least no problem today - but who knows what next Patch Tuesday will do ! ! !
Regards
Alan