简体   繁体   中英

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. Any ideas? (I do not want to use pskill in my script). 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! 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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