任务计划程序问题 - 无论用户是否登录都无法运行 [英] Task Scheduler Problem - Run whether user is logged on or not is not working

查看:162
本文介绍了任务计划程序问题 - 无论用户是否登录都无法运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个批处理文件,它依次调用 VB 脚本.VBScript 的任务包含一个宏,其工作是登录 Oracle 数据库、运行少量查询、获取 Excel 表中的输出,然后执行其他功能.

I have a batch file which in turn calls VB Script. The task of the VBScript contains a macro whose job is to login into the Oracle db, run few queries, fetch the output in Excel sheet and then it performs other functions.

当使用仅在用户登录时运行"选项时,脚本在调度程序中运行良好,但在选择无论用户是否登录时运行"选项时它不会运行.

The script is running fine in the scheduler when using the "Run only when user is logged in" option but it doesn't run when "Run whether user logged in or not" option is selected.

我尝试了之前帖子中建议的所有选项,但都没有奏效.

I tried all the options suggested here in previous posts but none of them worked.

推荐答案

我通过执行以下步骤解决了上述问题:

I resolved the above issue by performing below steps :

  1. 在以下路径创建空的桌面文件夹:

C:\Windows\System32\config\systemprofile\DesktopC:\Windows\SysWOW64\config\systemprofile\Desktop

C:\Windows\System32\config\systemprofile\Desktop C:\Windows\SysWOW64\config\systemprofile\Desktop

  1. 确保用户具有作为批处理作业登录"权限.

要启用此功能,请按照以下步骤操作:
a) 转到开始"菜单.
b) 键入 secpol.msc.然后按 Enter.
c) 本地安全策略管理器打开.
d) 转到安全设置 - 本地策略 - 用户权限分配节点.
e) 双击右侧的作为批处理作业登录.
f) 单击添加用户或组.
g) 选择用户.
h) 单击确定.

To enable this please follow below steps :
a) Go to the Start menu.
b) Type secpol.msc. and press Enter.
c) The Local Security Policy manager opens.
d) Go to Security Settings - Local Policies - User Rights Assignment node.
e) Double click Log on as a batch job on the right side.
f) Click Add User or Group.
g) Select the user.
h) Click OK.

  1. 创建一个文件并使用 .cmd 扩展名保存它..cmd 文件应包含以下 cmd :
    cscript.exe"

  1. Create a file and save it with .cmd extension. The .cmd file should contain below cmd :
    cscript.exe ""

在调度器中,给出如下路径:
• 程序/脚本:文件名(.cmd 文件名)
• 开始于(可选):文件路径(.cmd 文件的路径)

In the scheduler, give the path as follows :
• Program/script: filename (.cmd filename)
• Start in(optional): file path (path to .cmd file)

这篇关于任务计划程序问题 - 无论用户是否登录都无法运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆