Skip to main content
deleted 30 characters in body
Source Link
Io-oI
  • 8.8k
  • 3
  • 14
  • 42

Try changing the method mode used for elevating your bat to running as admin.

This one is a minimalist vbs that can help you elucidate if the error is in the bat or vbs code.

Try to run the bat commands directly on the command line, one by one, just to make sure that part / session is the error.

@echo off & setlocal EnableDelayedExpansion 

title <nul & title ..\%~nx0 & "%__APPDIR__%mode.com" 122,30 & color 0a & cd /d "%~dp0" 

2>nul "%__APPDIR__%whoami.exe" /groups | find "S-1-16-12288" >nul && goto :NXT: || <nul (
echo=CreateObject("Shell.Application"^).ShellExecute "%~sdpnx0", "%*", "RunAsAdministrator", "runas", 1: WScript.Quit
) >"%temp%\getadmin.vbs" && "%temp%\getadmin.vbs" //nologo && type "%temp%\getadmin.vbs"| clip &&2>nul del /q /f "%temp%\getadmin.vbs" && goto :eof

:NXT:
echo=Running custom startup tasks... <nul || "%__APPDIR__%timeout.exe" /t 3 >nul & echo\

echo\runas /user:*domainname*\*username* /savecred "C:\Program Files\EVGA\Precision X1\PrecisionX_x64.exe" -s
echo\runas /user:*domainname*\*username* /savecred "M:\Google Drive\Personal\Computer & Tech\Fixes & Scripts\AHK\Home.ahk"
echo\runas /user:*domainname*\*username* /savecred "M:\Program Files (x86)\Steam\steam.exe"
echo\runas /user:*domainname*\*username* /savecred "M:\Program Files\Rainmeter\Rainmeter.exe"

echo\Done^!! & "%__APPDIR__%timeout.exe" /t 5 & endlocal & goto :EOF
  • This is the vbs code without escaping:
CreateObject("Shell.Application").ShellExecute "C:\Users\ecker\AppData\Local\Temp\Q1C765~1.CMD", "arg1 arg2 arg3", "RunAsAdministrator", "runas", 1: WScript.Quit

// Note: To hide/suppress the cmd window while executions are in progress, change: "runas", 1  to "runas", 0 

Source/Inspiration in this answer by Riccardo La Marca

Try changing the method mode used for elevating your bat to running as admin.

This one is a minimalist vbs that can help you elucidate if the error is in the bat or vbs code.

Try to run the bat commands directly on the command line, one by one, just to make sure that part / session is the error.

@echo off & setlocal EnableDelayedExpansion 

title <nul & title ..\%~nx0 & "%__APPDIR__%mode.com" 122,30 & color 0a & cd /d "%~dp0" 

2>nul "%__APPDIR__%whoami.exe" /groups | find "S-1-16-12288" >nul && goto :NXT: || <nul (
echo=CreateObject("Shell.Application"^).ShellExecute "%~sdpnx0", "%*", "RunAsAdministrator", "runas", 1: WScript.Quit
) >"%temp%\getadmin.vbs" && "%temp%\getadmin.vbs" //nologo && type "%temp%\getadmin.vbs"| clip && del /q /f "%temp%\getadmin.vbs" && goto :eof

:NXT:
echo=Running custom startup tasks... <nul || "%__APPDIR__%timeout.exe" /t 3 >nul & echo\

echo\runas /user:*domainname*\*username* /savecred "C:\Program Files\EVGA\Precision X1\PrecisionX_x64.exe" -s
echo\runas /user:*domainname*\*username* /savecred "M:\Google Drive\Personal\Computer & Tech\Fixes & Scripts\AHK\Home.ahk"
echo\runas /user:*domainname*\*username* /savecred "M:\Program Files (x86)\Steam\steam.exe"
echo\runas /user:*domainname*\*username* /savecred "M:\Program Files\Rainmeter\Rainmeter.exe"

echo\Done^!! & "%__APPDIR__%timeout.exe" /t 5 & endlocal & goto :EOF
  • This is the vbs code without escaping:
CreateObject("Shell.Application").ShellExecute "C:\Users\ecker\AppData\Local\Temp\Q1C765~1.CMD", "arg1 arg2 arg3", "RunAsAdministrator", "runas", 1: WScript.Quit

// Note: To hide/suppress the cmd window while executions are in progress, change: "runas", 1  to "runas", 0 

Source/Inspiration in this answer by Riccardo La Marca

Try changing the method mode used for elevating your bat to running as admin.

This one is a minimalist vbs that can help you elucidate if the error is in the bat or vbs code.

Try to run the bat commands directly on the command line, one by one, just to make sure that part / session is the error.

@echo off & setlocal EnableDelayedExpansion 

title <nul & title ..\%~nx0 & "%__APPDIR__%mode.com" 122,30 & color 0a & cd /d "%~dp0" 

2>nul "%__APPDIR__%whoami.exe" /groups | find "S-1-16-12288" >nul && goto :NXT: || <nul (
echo=CreateObject("Shell.Application"^).ShellExecute "%~sdpnx0", "%*", "RunAsAdministrator", "runas", 1: WScript.Quit
) >"%temp%\getadmin.vbs" && "%temp%\getadmin.vbs" //nologo && 2>nul del /q /f "%temp%\getadmin.vbs" && goto :eof

:NXT:
echo=Running custom startup tasks... <nul || "%__APPDIR__%timeout.exe" /t 3 >nul & echo\

echo\runas /user:*domainname*\*username* /savecred "C:\Program Files\EVGA\Precision X1\PrecisionX_x64.exe" -s
echo\runas /user:*domainname*\*username* /savecred "M:\Google Drive\Personal\Computer & Tech\Fixes & Scripts\AHK\Home.ahk"
echo\runas /user:*domainname*\*username* /savecred "M:\Program Files (x86)\Steam\steam.exe"
echo\runas /user:*domainname*\*username* /savecred "M:\Program Files\Rainmeter\Rainmeter.exe"

echo\Done^!! & "%__APPDIR__%timeout.exe" /t 5 & endlocal & goto :EOF
  • This is the vbs code without escaping:
CreateObject("Shell.Application").ShellExecute "C:\Users\ecker\AppData\Local\Temp\Q1C765~1.CMD", "arg1 arg2 arg3", "RunAsAdministrator", "runas", 1: WScript.Quit

// Note: To hide/suppress the cmd window while executions are in progress, change: "runas", 1  to "runas", 0 

Source/Inspiration in this answer by Riccardo La Marca

added 15 characters in body
Source Link
Io-oI
  • 8.8k
  • 3
  • 14
  • 42

Try changing the method mode used for elevating your bat to running as admin.

This one is a minimalist vbs that can help you elucidate if the error is in the bat or vbs code.

Try to run the bat commands directly on the command line, one by one, just to make sure that part / session is the error.

@echo off & setlocal EnableDelayedExpansion 

title <nul & title ..\%~nx0 & "%__APPDIR__%mode.com" 122,30 & color 0a & cd /d "%~dp0" 

2>nul "%__APPDIR__%whoami.exe" /groups | find "S-1-16-12288" >nul && goto :NXT: || <nul (
echo=CreateObject("Shell.Application"^).ShellExecute "%~sdpnx0", "%*", "RunAsAdministrator", "runas", 1: WScript.Quit
) >"%temp%\getadmin.vbs" && "%temp%\getadmin.vbs" //nologo && type "%temp%\getadmin.vbs"| clip && del /q /f "%temp%\getadmin.vbs" && goto :eof

:NXT:
echo=Running custom startup tasks... <nul || "%__APPDIR__%timeout.exe" /t 3 >nul & echo\

echo\runas /user:*domainname*\*username* /savecred "C:\Program Files\EVGA\Precision X1X1\PrecisionX_x64.exe" -s
echo\runas /user:*domainname*\*username* /savecred "M:\Google Drive\Personal\Computer & Tech\Fixes & Scripts\AHK\Home.ahk"
echo\runas /user:*domainname*\*username* /savecred "M:\Program Files (x86)\Steam\steam.exe"
echo\runas /user:*domainname*\*username* /savecred "M:\Program Files\Rainmeter\Rainmeter.exe"

echo\Done^!! & "%__APPDIR__%timeout.exe" /t 5 & endlocal & goto :EOF
  • This is the vbs code without escaping:
CreateObject("Shell.Application").ShellExecute "C:\Users\ecker\AppData\Local\Temp\Q1C765~1.CMD", "arg1 arg2 arg3", "RunAsAdministrator", "runas", 1: WScript.Quit

// Note: To hide/suppress the cmd window while executions are in progress, change: "runas", 1  to "runas", 0 

Source/Inspiration in this answer by Riccardo La Marca

Try changing the method mode used for elevating your bat to running as admin.

This one is a minimalist vbs that can help you elucidate if the error is in the bat or vbs code.

Try to run the bat commands directly on the command line, one by one, just to make sure that part / session is the error.

@echo off & setlocal EnableDelayedExpansion 

title <nul & title ..\%~nx0 & "%__APPDIR__%mode.com" 122,30 & color 0a & cd /d "%~dp0" 

2>nul "%__APPDIR__%whoami.exe" /groups | find "S-1-16-12288" >nul && goto :NXT: || <nul (
echo=CreateObject("Shell.Application"^).ShellExecute "%~sdpnx0", "%*", "RunAsAdministrator", "runas", 1: WScript.Quit
) >"%temp%\getadmin.vbs" && "%temp%\getadmin.vbs" //nologo && type "%temp%\getadmin.vbs"| clip && del /q /f "%temp%\getadmin.vbs" && goto :eof

:NXT:
echo=Running custom startup tasks... <nul || "%__APPDIR__%timeout.exe" /t 3 >nul & echo\

echo\runas /user:*domainname*\*username* /savecred "C:\Program Files\EVGA\Precision X1.exe" -s
echo\runas /user:*domainname*\*username* /savecred "M:\Google Drive\Personal\Computer & Tech\Fixes & Scripts\AHK\Home.ahk"
echo\runas /user:*domainname*\*username* /savecred "M:\Program Files (x86)\Steam\steam.exe"
echo\runas /user:*domainname*\*username* /savecred "M:\Program Files\Rainmeter\Rainmeter.exe"

echo\Done^!! & "%__APPDIR__%timeout.exe" /t 5 & endlocal & goto :EOF
  • This is the vbs code without escaping:
CreateObject("Shell.Application").ShellExecute "C:\Users\ecker\AppData\Local\Temp\Q1C765~1.CMD", "arg1 arg2 arg3", "RunAsAdministrator", "runas", 1: WScript.Quit

// Note: To hide/suppress the cmd window while executions are in progress, change: "runas", 1  to "runas", 0 

Source/Inspiration in this answer by Riccardo La Marca

Try changing the method mode used for elevating your bat to running as admin.

This one is a minimalist vbs that can help you elucidate if the error is in the bat or vbs code.

Try to run the bat commands directly on the command line, one by one, just to make sure that part / session is the error.

@echo off & setlocal EnableDelayedExpansion 

title <nul & title ..\%~nx0 & "%__APPDIR__%mode.com" 122,30 & color 0a & cd /d "%~dp0" 

2>nul "%__APPDIR__%whoami.exe" /groups | find "S-1-16-12288" >nul && goto :NXT: || <nul (
echo=CreateObject("Shell.Application"^).ShellExecute "%~sdpnx0", "%*", "RunAsAdministrator", "runas", 1: WScript.Quit
) >"%temp%\getadmin.vbs" && "%temp%\getadmin.vbs" //nologo && type "%temp%\getadmin.vbs"| clip && del /q /f "%temp%\getadmin.vbs" && goto :eof

:NXT:
echo=Running custom startup tasks... <nul || "%__APPDIR__%timeout.exe" /t 3 >nul & echo\

echo\runas /user:*domainname*\*username* /savecred "C:\Program Files\EVGA\Precision X1\PrecisionX_x64.exe" -s
echo\runas /user:*domainname*\*username* /savecred "M:\Google Drive\Personal\Computer & Tech\Fixes & Scripts\AHK\Home.ahk"
echo\runas /user:*domainname*\*username* /savecred "M:\Program Files (x86)\Steam\steam.exe"
echo\runas /user:*domainname*\*username* /savecred "M:\Program Files\Rainmeter\Rainmeter.exe"

echo\Done^!! & "%__APPDIR__%timeout.exe" /t 5 & endlocal & goto :EOF
  • This is the vbs code without escaping:
CreateObject("Shell.Application").ShellExecute "C:\Users\ecker\AppData\Local\Temp\Q1C765~1.CMD", "arg1 arg2 arg3", "RunAsAdministrator", "runas", 1: WScript.Quit

// Note: To hide/suppress the cmd window while executions are in progress, change: "runas", 1  to "runas", 0 

Source/Inspiration in this answer by Riccardo La Marca

added 108 characters in body
Source Link
Io-oI
  • 8.8k
  • 3
  • 14
  • 42

Try changing the method mode used for elevating your bat to running as admin.

This one is a minimalist vbs that can help you elucidate if the error is in the bat or vbs code.

Try to run the bat commands directly on the command line, one by one, just to make sure that part / session is the error.

@echo off & setlocal EnableDelayedExpansion 

title <nul & title ..\%~nx0 & "%__APPDIR__%mode.com" con: cols=122 lines=10122,30 & color 0a

  & cd /d "%~dp0" &&  

2>nul "%__APPDIR__%whoami.exe" /groups | find "S-1-16-12288" >nul && goto :NXT: || <nul (
echo=CreateObject("Shell.Application"^).ShellExecute "%~sdpnx0", "%*", "RunAsAdministrator", "runas", 1: WScript.Quit
) >"%temp%\getadmin.vbs" && "%temp%\getadmin.vbs" //nologo && type "%temp%\getadmin.vbs"| clip && del /q /f "%temp%\getadmin.vbs" && goto :eof

:NXT:
echo=Running custom startup tasks... " <nul &|| "%__APPDIR__%timeout.exe" /t 23 >nul & echo\ 

echo\runas /user:*domainname*\*username* /savecred "C:\Program Files\EVGA\Precision X1.exe" -s
echo\runas /user:*domainname*\*username* /savecred "M:\Google Drive\Personal\Computer & Tech\Fixes & Scripts\AHK\Home.ahk"
echo\runas /user:*domainname*\*username* /savecred "M:\Program Files (x86)\Steam\steam.exe"
echo\runas /user:*domainname*\*username* /savecred "M:\Program Files\Rainmeter\Rainmeter.exe"

echo\Done^!! & "%__APPDIR__%timeout.exe" /t 5 & endlocal & goto :EOF
  • This is the vbs code without escaping:
CreateObject("Shell.Application").ShellExecute "F"C:\SU\Q1B5D7~1\Users\ecker\AppData\Local\Temp\Q1C765~1.CMD", "1"arg1 2arg2 3"arg3", "RunAsAdministrator", "runas", 1: WScript.Quit

// Note: To hide/suppress the cmd window while executions are in progress, change: "runas", 1  to "runas", 0 

Source/Inspiration in this answer by Riccardo La Marca

Try changing the method mode used for elevating your bat to running as admin.

This one is a minimalist vbs that can help you elucidate if the error is in the bat or vbs code.

Try to run the bat commands directly on the command line, one by one, just to make sure that part / session is the error.

@echo off & setlocal EnableDelayedExpansion

title <nul & title ..\%~nx0 & "%__APPDIR__%mode.com" con: cols=122 lines=10 & color 0a

 cd /d "%~dp0" && 2>nul "%__APPDIR__%whoami.exe" /groups | find "S-1-16-12288" >nul && goto :NXT: || <nul (
echo=CreateObject("Shell.Application"^).ShellExecute "%~sdpnx0", "%*", "RunAsAdministrator", "runas", 1: WScript.Quit
) >"%temp%\getadmin.vbs" && "%temp%\getadmin.vbs" //nologo && del /q /f "%temp%\getadmin.vbs" && goto :eof

:NXT:
echo=Running custom startup tasks... "  & "%__APPDIR__%timeout.exe" /t 2 >nul & echo\
echo\runas /user:*domainname*\*username* /savecred "C:\Program Files\EVGA\Precision X1.exe" -s
echo\runas /user:*domainname*\*username* /savecred "M:\Google Drive\Personal\Computer & Tech\Fixes & Scripts\AHK\Home.ahk"
echo\runas /user:*domainname*\*username* /savecred "M:\Program Files (x86)\Steam\steam.exe"
echo\runas /user:*domainname*\*username* /savecred "M:\Program Files\Rainmeter\Rainmeter.exe"

echo\Done^!! & "%__APPDIR__%timeout.exe" /t 5 & endlocal & goto :EOF
  • This is the vbs code without escaping:
CreateObject("Shell.Application").ShellExecute "F:\SU\Q1B5D7~1.CMD", "1 2 3", ,"runas", 1: WScript.Quit

// Note: To hide/suppress the cmd window while executions are in progress, change: "runas", 1  to "runas", 0 

Source/Inspiration in this answer by Riccardo La Marca

Try changing the method mode used for elevating your bat to running as admin.

This one is a minimalist vbs that can help you elucidate if the error is in the bat or vbs code.

Try to run the bat commands directly on the command line, one by one, just to make sure that part / session is the error.

@echo off & setlocal EnableDelayedExpansion 

title <nul & title ..\%~nx0 & "%__APPDIR__%mode.com" 122,30 & color 0a & cd /d "%~dp0"  

2>nul "%__APPDIR__%whoami.exe" /groups | find "S-1-16-12288" >nul && goto :NXT: || <nul (
echo=CreateObject("Shell.Application"^).ShellExecute "%~sdpnx0", "%*", "RunAsAdministrator", "runas", 1: WScript.Quit
) >"%temp%\getadmin.vbs" && "%temp%\getadmin.vbs" //nologo && type "%temp%\getadmin.vbs"| clip && del /q /f "%temp%\getadmin.vbs" && goto :eof

:NXT:
echo=Running custom startup tasks... <nul || "%__APPDIR__%timeout.exe" /t 3 >nul & echo\ 

echo\runas /user:*domainname*\*username* /savecred "C:\Program Files\EVGA\Precision X1.exe" -s
echo\runas /user:*domainname*\*username* /savecred "M:\Google Drive\Personal\Computer & Tech\Fixes & Scripts\AHK\Home.ahk"
echo\runas /user:*domainname*\*username* /savecred "M:\Program Files (x86)\Steam\steam.exe"
echo\runas /user:*domainname*\*username* /savecred "M:\Program Files\Rainmeter\Rainmeter.exe"

echo\Done^!! & "%__APPDIR__%timeout.exe" /t 5 & endlocal & goto :EOF
  • This is the vbs code without escaping:
CreateObject("Shell.Application").ShellExecute "C:\Users\ecker\AppData\Local\Temp\Q1C765~1.CMD", "arg1 arg2 arg3", "RunAsAdministrator", "runas", 1: WScript.Quit

// Note: To hide/suppress the cmd window while executions are in progress, change: "runas", 1  to "runas", 0 

Source/Inspiration in this answer by Riccardo La Marca

added 108 characters in body
Source Link
Io-oI
  • 8.8k
  • 3
  • 14
  • 42
Loading
added 149 characters in body
Source Link
Io-oI
  • 8.8k
  • 3
  • 14
  • 42
Loading
added 683 characters in body
Source Link
Io-oI
  • 8.8k
  • 3
  • 14
  • 42
Loading
added 4 characters in body
Source Link
Io-oI
  • 8.8k
  • 3
  • 14
  • 42
Loading
deleted 37 characters in body
Source Link
Io-oI
  • 8.8k
  • 3
  • 14
  • 42
Loading
deleted 5 characters in body
Source Link
Io-oI
  • 8.8k
  • 3
  • 14
  • 42
Loading
Source Link
Io-oI
  • 8.8k
  • 3
  • 14
  • 42
Loading