I've seen there are a plethora of different posts and solutions regarding this specific issue, yet for some reason after implementing nearly all the results I've come across I'm still maddeningly enough getting the cannot find the path specific
error for some reason.
Here's my script:
@echo off
set "params=%*"
cd /d "%~dp0" && ( if exist "%temp%\getadmin.vbs" del "%temp%\getadmin.vbs" ) && fsutil ^
dirty query %systemdrive% 1>nul 2>nul || ( echo Set UAC = ^
CreateObject^("Shell.Application"^) : UAC.ShellExecute "cmd.exe", "/k cd ""%~sdp0"" ^
&& %~s0 %params%", "", "runas", 1 >> "%temp%\getadmin.vbs" && "%temp%\getadmin.vbs" ^
&& exit /B )
echo Running custom startup tasks...
pause
runas "/user:*domainname*\*username* /savecred ^
"C:\Program Files\EVGA\Precision X1" -s"
runas "/user:*domainname*\*username* /savecred ^
"M:\Google Drive\Personal\Computer & Tech\Fixes &" Scripts\AHK\Home.ahk"
runas "/user:*domainname*\*username* /savecred ^
"M:\Program Files (x86)\Steam\steam.exe""
runas "/user:*domainname*\*username* /savecred ^
"M:\Program Files\Rainmeter\Rainmeter.exe""
echo Done!
pause
exit
Please note that I've redacted the parts within ** above for privacy.
M:/
is a local HHD, not a mapped network drive. And yes, that is the idea, I have some startup programs that are inshell:startup
but are not being launched at startup, so I'm attempting to fix that by using a .bat instead.&&
in:&& %~s0
maybe :& %~s0
...& Tech\Fixes &" ...
???&
how can I escape it properly, assuming that's the cause to the error? I've already tried && as well, which doesn't work as you suspected.