Advertisement
Najeebsk

RUN-CMD-TXT.bat

Jun 4th, 2022
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 0.53 KB | None | 0 0
  1. @ECHO OFF
  2. TITLE NAJEEB RUN COMMANDS IN TEXT FILE
  3. mode con cols=10 lines=4
  4. Color E9
  5. set "params=%*"
  6. 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 )
  7.  
  8. SET cmdtxt=%~1
  9.  
  10. FOR /F "USEBACKQ TOKENS=*" %%A IN ("CMD.txt") do (
  11.     cmd /c "%%~A"
  12.     )
  13. ::PAUSE
  14. EXIT
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement