简体   繁体   English

Windows Task Scheduler-任务不会死

[英]Windows Task Scheduler - Task Won't Die

I have a task scheduled to run daily that executes a .bat file and I have checked the options for ending the task after an hour and forcing it to stop if it does not end when requested to, but it runs indefinitely until I manually kill it. 我有一个计划每天运行的任务,该任务执行一个.bat文件,并且我已经检查了一个小时后结束该任务的选项,并在请求未终止时强制将其停止,但是该任务会无限期运行,直到我手动将其杀死。 Any ideas? 有任何想法吗? (I do not want to use pskill in my script). (我不想在脚本中使用pskill)。 Script below: 脚本如下:

sqlcmd -S MyServer -U username -P password _Q "BACKUP DATABASE x to y"
net use z: "\\server1\project"
cd C:\trial1
copy * "Z:\backups"
net use z: /delete
exit

Thanks to Hans Passant for the answer! 感谢Hans Passant的回答! See below: 见下文:

Taking away 'net use' and just directly copying to the server cleared up some error that the task scheduler was getting stuck on. 删除“网络使用”并直接复制到服务器,可以清除任务计划程序卡住的一些错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM