Synopsis: create a .bat file on a network share, simply put pause
in it, then save. Right-click new file & 'Run as administrator' it closes right away, why?
Moving the file to the local PC (%SYSTEMDRIVE%) it will work correctly. So its clearly an issue with the UNC path? How can I fix? I tried putting pushd "%~dp0"
as the first-line, but same instant close issue. If your wondering what I am trying to do, here a snippet:
echo ------MADE BY ME-----
REM install from batch file location, a network UNC path
msiexec /i "%~dp0AppNameHere.msi" /qn /norestart /log %TEMP%\AppNameHere.log
echo Instructions > %PUBLIC%\Desktop\HowToUseApp.txt
If I double-click batch it fails with access denied. Right-clicking batch file & 'Run as administrator' causes it to open & close quickly. If I open cmd as admin, then run batch it works fine. I am confused as to the cause. If I create a new batch file