繁体   English   中英

如何在Windows终端中运行schtasks命令/.cmd批处理文件(不以管理员身份运行)

[英]How to run schtasks commands/.cmd batch file in Windows terminal (not run as administrator)

打开Windows终端并以管理员身份运行,我可以成功运行schtasks命令,而无需输入用户名和密码。

但是,如果我双击cmd打开Windows终端(不以管理员身份运行),则会出现拒绝访问错误。 在这种情况下,如何运行schtasks在任务计划程序中创建任务? 还是运行具有schtasks命令的.cmd批处理文件? 是否可以输入admin或当前的登录用户名和密码来运行命令?

schtasks /create /? 第一组( /u/p )是您以谁身份运行schtasks程序。 第二组( /ru/rp )是任务应运行的方式。 /U/P在所有子命令中均可用。

/U   username      Specifies the user context under which SchTasks.exe
                   should execute.

/P   [password]    Specifies the password for the given user context.
                   Prompts for input if omitted.

/RU  username      Specifies the "run as" user account (user context)
                   under which the task runs. For the system account,
                   valid values are "", "NT AUTHORITY\SYSTEM"
                   or "SYSTEM".
                   For v2 tasks, "NT AUTHORITY\LOCALSERVICE" and
                   "NT AUTHORITY\NETWORKSERVICE" are also available as well
                   as the well known SIDs for all three.

/RP  [password]    Specifies the password for the "run as" user.
                   To prompt for the password, the value must be either
                   "*" or none. This password is ignored for the
                   system account. Must be combined with either /RU or
                   /XML switch.

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM