任务计划程序(运行,无论用户是否登录) [英] Task Scheduler (run whether user is logged on or not)
问题描述
我在Windows 7中安排任务时遇到问题我正在创建一个映射到bat文件以执行的任务,这是我的.bat文件:
I'm having a problem with scheduling a task in Windows 7 I m creating a task which is mapped to a bat file to execute, here is my .bat file :
cd "C:\soft\"
Start excel "" "AD Auto Run.xlsm"
选择选项(单选按钮)仅在用户登录时运行"时,它会自动和手动工作.
its working automaticaly and manually when the option (radio button) "Run only when the user is logged on" is selected.
但自动/手动RUN是行不通的.
but the automatic/manual RUN is not working when the option (radio button) "Run whether user logged on or not" is selected.
推荐答案
我通过执行以下步骤解决了该问题:
I resolved the issue by performing these steps:
在以下路径中创建空的Desktop文件夹:
Create the empty Desktop folders at the below path:
C:\ Windows \ System32 \ config \ systemprofile \ Desktop C:\ Windows \ SysWOW64 \ config \ systemprofile \ Desktop
C:\Windows\System32\config\systemprofile\Desktop C:\Windows\SysWOW64\config\systemprofile\Desktop
确保用户具有作为批处理作业登录"权限.
Make sure user has "log on as batch job" permission.
要启用此功能,请按照以下步骤操作:
To enable this please follow below steps:
a)转到开始"菜单.
a) Go to the Start menu.
b)键入secpol.msc.然后按Enter.
b) Type secpol.msc. and press Enter.
c)本地安全策略管理器打开.
c) The Local Security Policy manager opens.
d)转到安全设置-本地策略-用户权限分配"节点.
d) Go to Security Settings - Local Policies - User Rights Assignment node.
e)双击右侧的作为批处理作业登录".
e) Double click Log on as a batch job on the right side.
f)单击添加用户或组.
f) Click Add User or Group.
g)选择用户.
h)单击确定.
创建一个文件并以.cmd扩展名保存..cmd文件应包含以下cmd:
Create a file and save it with .cmd extension. The .cmd file should contain below cmd:
cscript.exe "<path to .vbs file>"
在调度程序中,给出如下路径:
In the scheduler, give the path as follows:
•程序/脚本:文件名(.cmd文件名)
• Program/script: filename (.cmd filename)
•开始于(可选):文件路径(.cmd文件的路径)
• Start in(optional): file path (path to .cmd file)
这篇关于任务计划程序(运行,无论用户是否登录)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!