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.