Skip to main content
Made post readable. The script can still be executed. Just added ^ linebreaks.
Source Link
LPChip
  • 64.3k
  • 11
  • 108
  • 152

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.

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.

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.

added 46 characters in body
Source Link
LPChip
  • 64.3k
  • 11
  • 108
  • 152

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

@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.

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.

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.

Source Link
Arctiic
  • 1.3k
  • 1
  • 14
  • 29

Startup .bat throws "cannot find the path specified" error

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.