Tag Archives: schtasks

A Script to create a a Scheduled Task that runs under the SYSTEM account

By | September 23, 2016
Share

echo start /w “” notepad.exe > “%WinDir%\Temp\temp.bat” echo del /f/q “%%WinDir%%\Temp\temp.bat” >> “%WinDir%\Temp\temp.bat” schtasks /create /ru “NT AUTHORITY\SYSTEM” /tn “sysrun” /tr “cmd.exe /c “”%WinDir%\Temp\temp.bat””” /f /sc “ONIDLE” /i “999” schtasks /run /tn “sysrun” /i :loop for /f “tokens=2 delims=: ” %%f in (‘schtasks /query /tn “sysrun” /fo list ^| find “Status:”‘ ) do ( if… Read More »