Skip to content

Instantly share code, notes, and snippets.

@KillerGoldFisch
Last active March 30, 2016 14:07
Show Gist options
  • Save KillerGoldFisch/5158bb8f580e7d72f95c8f2c9d31617b to your computer and use it in GitHub Desktop.
Save KillerGoldFisch/5158bb8f580e7d72f95c8f2c9d31617b to your computer and use it in GitHub Desktop.
Run Task at user logon with highest privileges
schtasks /delete /tn TASKNAME /f
SCHTASKS /CREATE /TN TASKNAME /TR "%SYSTEMROOT%\TASK.exe" /SC onlogon /RU %USERDOMAIN%\%USERNAME% /RL HIGHEST /f
rem SCHTASKS /CREATE /TN TASKNAME /TR "%SYSTEMROOT%\TASK.exe" /SC onstart /RU %USERDOMAIN%\%USERNAME% /RL HIGHEST /f
SCHTASKS /Run /TN TASKNAME
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment