预定时预定的任务称为批处理文件会抛出错误,运行良好时双击了 [英] Batch file called by scheduled task throws error when scheduled, runs fine when double clicked

查看:126
本文介绍了预定时预定的任务称为批处理文件会抛出错误,运行良好时双击了的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个映射网络驱动器的批处理文件。大约一个星期左右前密码过期,所以程序调用批处理文件开始抛出错误。

I have a batch file that maps a networked drive. About a week or so ago the password expired, so the program calling the batch file started throwing errors.

我已经更新在批处理文件中的密码,当我双击该批处理文件,驱动器映射罚款。然而,当计划任务拉开序幕,我得到以下错误:

I've updated the password in the batch file, and when I double click on the batch file, the drive maps fine. However, when the scheduled task kicks off, I get the following error:

Logon failure: unknown user name or bad password.

任何人都见过这个?我试着重新创建计划任务,但它似乎并没有任何区别。

Anyone seen this before? I've tried recreating the scheduled task, but it doesn't seem to make any difference.

修改

我已经更新了计划任务,这是没有问题的性质。这个问题似乎是在批处理文件中的用户名和密码。奇怪的是,如果我以交互方式登录,然后双击可执行文件,一切都完美。

I've updated the properties of the scheduled task, which isn't the problem. The problem seems to be the username and password in the batch file. The strange thing is if I log on interactively and double click the executable, everything works perfectly.

上一次作业运行它扔了一个信号灯超时时间已过期的错误。我从来没见过此特定错误,但似乎它实际上是登录并尝试当这发生在复制文件。

The last time the job ran it threw a "semaphore timeout period has expired" error. I've never seen this particular error before, but it seems like it was actually logged on and trying to copy files when this happened.

修改

我修改我的code,使之尽可能简单。我使用一个批处理文件来映射驱动器,然后用code传输文件。我仍然会碰到同样的问题 - 它工作得很好,当我双击该批处理文件,但一旦我把调度到图片,它抛出一个错误的用户名或密码无效的错误

I've revised my code to make it as simple as possible. I'm using a batch file to map the drive, then using code to transfer the files. I still run into the same issue - it works fine when I double click the batch file, but once I throw Scheduler into the picture, it throws a "Bad username or invalid password" error.

偶尔当我试图通过运行在其上双击该文件,我得到一个找不到路径的一部分的错误。这对我说的驱动器映射实际工作,但是当它试图复制的东西失败。 (在大多数情况下,通过双击测试正常工作)

Occasionally when I'm trying to run the file by double clicking on it, I get a "Could not find part of the path" error. This says to me the drive mapping actually worked but something failed when it was trying to copy. (Most of the time, testing by double clicking works fine)

推荐答案

在创建它不再有效或者已经改变了与任务相关的用户名和密码。
这个创建任务,并忘记选择不存储密码的选项时,通常会发生。当你的密码设置为过期,那么你会遇到这个问题,每次你将不得不重置您的密码。确保做到像在图像上:

The username and password associated with the task when you created it is no longer valid or has changed. This occurs generally when creating the task and forgetting to select the option not to store the password. When your password is set to expire, then you will meet this problem everytime you will have to reset your password. Make sure to do as on the image :

这篇关于预定时预定的任务称为批处理文件会抛出错误,运行良好时双击了的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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