如何使用 SCHTASKS 在 SYSTEM 用户帐户下创建计划任务
我目前正在尝试使用以下命令让 SCHTASKS 在 SYSTEM 帐户下创建计划任务:
schtasks.exe" /s "\\" /u "SYSTEM" /Create /SC DAILY /MO "7" /ST "12:00" /TN "mytask" /TR "C:\test.exe "C:\""
虽然它输出:
ERROR: User credentials are not allowed on the local machine.
I am currently trying to get SCHTASKS to create a scheduled task under the SYSTEM account, by using the following command:
schtasks.exe" /s "\\" /u "SYSTEM" /Create /SC DAILY /MO "7" /ST "12:00" /TN "mytask" /TR "C:\test.exe "C:\""
Although it outputs:
ERROR: User credentials are not allowed on the local machine.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
打开提升的(管理)命令提示符。
输入以下命令:
schtasks.exe /s "\" /ru "SYSTEM" /Create /SC DAILY /MO "7" /ST "12:00" /TN "mytask" /TR "C:\test.exe "C: \"
请注意区别在于,为了指定 SYSTEM 帐户,您需要使用
/RU
开关,而不是/U一个。
Open an elevated (admin) command prompt.
Enter the following command:
schtasks.exe /s "\" /ru "SYSTEM" /Create /SC DAILY /MO "7" /ST "12:00" /TN "mytask" /TR "C:\test.exe "C:\"
Please note the difference is that, in order to specify the SYSTEM account, you need to use the
/RU
switch and not the/U
one.schtasks.exe /create /RU SYSTEM /TN“文件夹\任务名称”/XML“I:\位置\任务名称.xml”
每个任务的行数根据需要而定,然后将文件另存为批处理 (.bat),以管理员身份运行(右键单击以管理员身份运行)。
schtasks.exe /create /RU SYSTEM /TN "Folder\TaskName" /XML "I:\Location\TaskName.xml"
as many lines as you want, with each task, then save file as batch (.bat), run as administrator (right click run as admin).