Windows 计划任务成功但返回结果 0x1 [英] Windows Scheduled task succeeds but returns result 0x1

查看:224
本文介绍了Windows 计划任务成功但返回结果 0x1的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Windows 2008 R2 服务器上有一个计划任务.该任务包括一个开始于目录条目.任务运行,它运行的批处理文件做它应该做的事情.当我从命令提示符运行批处理文件时,我看不到任何错误.问题是上次运行结果"是 0x1(不正确的函数调用).

I have a scheduled task on a Windows 2008 R2 server. The task includes a Start In directory entry. The task runs, and the batch file it runs does what it is supposed to do. When I run the batch file from a command prompt, I see no errors. The problem is that the "Last run result" is 0x1 (incorrect function call).

我确实有一次使用不正确的 DOS 语句 IF EXISTS file.txt DO (Copy file.txt file1.txt) 得到了这个,该语句通过删除 DO 得到纠正> 声明.当前的批处理文件没有显示任何错误或警告.

I did get this at one time with an incorrect DOS statement IF EXISTS file.txt DO (Copy file.txt file1.txt) that was corrected by dropping the DO statement. The current batch file does not show me any errors or warnings.

为什么我得到 0x1 结果?

Why am I getting a 0x1 result?

运行的批处理文件:

PUSHD \\JUKEBOX4\Archives\CallRecording
REM only move csv and wma together.  wma should be created last.
IF NOT EXIST C:\CallRecording (MKDIR C:\CallRecording)
FOR /f %%f IN ('DIR /b *.wma') DO (
    IF EXIST %%~nf.csv (MOVE /Y %%~nf.* C:\CallRecording\)
)
POPD
CD /D "C:\Program Files (x86)\Olim, LLC\Collybus DR Upload"
CollybusUpload.exe
POPD

关于计划任务设置的信息:

Info on scheduled task setup:

  • 要运行的程序:C:\Program Files (x86)\Olim, LLC\Collybus DR Upload\CallRecordingUploadFromH.cmd
  • 开始于:C:\Program Files (x86)\Olim, LLC\Collybus DR Upload
  • 无论用户是否登录都运行,最高权限.

历史画面,任务完成入口

History screen, task completed entry

任务计划程序成功完成任务\呼叫录音上传到门户从 NH",实例{1449ad42-2210-427a-bd69-2c15e35340e6}",动作C:\Windows\SYSTEM32\cmd.exe"并返回代码 1."

"Task Scheduler successfully completed task "\Call recording upload to portal from NH" , instance "{1449ad42-2210-427a-bd69-2c15e35340e6}" , action "C:\Windows\SYSTEM32\cmd.exe" with return code 1."

任务计划程序的第一个屏幕显示成功"的运行结果"

First screen of Task Scheduler shows "Run Result" of "Success"

推荐答案

似乎很多用户都遇到了这个问题.以下是一些修复:

It seems many users are having issues with this. Here are some fixes:

  • 右键单击您的任务>属性">操作">编辑"|仅将文件名放在程序/脚本"下,没有引号,并且仅将目录放在开始于"下,同样没有引号.

  • Right click on your task > "Properties" > "Actions" > "Edit" | Put ONLY the file name under 'Program/Script', no quotes and ONLY the directory under 'Start in' as described, again no quotes.

右键单击您的任务>属性">常规"|使用以下任何/所有内容进行测试:

Right click on your task > "Properties" > "General" | Test with any/all of the following:

  1. 以最高权限运行"(测试两个选项)
  2. 无论用户是否登录都运行"(测试两个选项)
  3. 检查配置为"是否设置为您机器的操作系统版本
  4. 确保运行该程序的用户帐户具有正确的权限

这篇关于Windows 计划任务成功但返回结果 0x1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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