任务计划程序的状态仍显示为运行BAT后完成了它的任务 [英] Task Scheduler status still shows as Running after a BAT completes its task
问题描述
我试图创建我可以在Windows 7任务管理器使用用户的本地谷歌地球文件复制到那里可以备份网络位置的批处理文件。看来,BAT运行得很好,但一旦它的完成和放大器的任务无法完成或停止;继续显示正在运行。
的状态在先进的感谢您的建议!
COPY / YC:\\用户\\ lena.domain \\应用程序数据\\ LocalLow \\谷歌\\ GoogleEarth的\\的myplaces.kml为\\\\ server \\ U-用户\\莉娜\\系统备份\\谷歌地球的cmd.exe / C
运行你的一行在错误信息在命令提示符窗口的结果:语法错误
原因1:没有命令复制
和选择 / Y
之间没有空格
原因2:有的cmd.exe / c
在该行的末尾追加
使用在批处理文件中的行:
COPY / YC:\\用户\\ lena.domain \\应用程序数据\\ LocalLow \\谷歌\\ GoogleEarth的\\的myplaces.kml为\\\\ server \\ U-用户\\莉娜\\系统备份\\谷歌地球
和另外确保这项工作是从任务调度与凭证(帐户)执行有写在服务器的东西的权限。通常用于计划任务在本地系统帐户具有肯定是没有权限在所有访问服务器上的文件。它看起来像最好的帐户用于该计划的任务是 lena.domain
的用户帐户。另请参见配置计划任务项(至少是Windows 7)
I'm attempting to create a batch file that I can use with Task Manager in Windows 7 to copy users' local Google Earth file to a network location where it can be backed-up. It appears that the BAT is running just fine, but the task does not complete or stop once it's done & continues to show a status of "running".
Thanks in advanced for the suggestions!
COPY/Y "C:\Users\lena.domain\AppData\LocalLow\Google\GoogleEarth\myplaces.kml" "\\server\u-users\Lena\system backup\Google Earth" cmd.exe /C
Running your single line in a command prompt window results in error message: syntax error
Reason 1: There is no space between command COPY
and option /Y
.
Reason 2: There is cmd.exe /C
appended at end of the line.
Use in your batch file the line:
COPY /Y "C:\Users\lena.domain\AppData\LocalLow\Google\GoogleEarth\myplaces.kml" "\\server\u-users\Lena\system backup\Google Earth"
And additionally make sure that this job is executed from task scheduler with credentials (account) which has the permission to write something on server. The local SYSTEM account often used for scheduled tasks has surely no permissions to access files on the server at all. It looks like the best account to use for this scheduled task is the user account of lena.domain
. See also Configure a Scheduled Task Item (At least Windows 7)
这篇关于任务计划程序的状态仍显示为运行BAT后完成了它的任务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!