Windows 计划任务在任务完成后继续 运行

Windows Schedule Task continues to run after task completes

我在 Windows 2012 R2 服务器上有一个 windows 计划任务,它运行一个 .bat 文件,该文件执行以下

cd /D "C:\Program Files (x86)\WinSCP"
WinSCP /script="C:\Users\Administrator\AI_SFTP_Download\SFTP_Download.txt" /log="C:\Users\Administrator\AI_SFTP_Download\winscp.log"
exit /b

这是我的SFTP_Download.txt脚本

# Connect
open "xxxxxxxx" -hostkey="xxxxxxxxxxxxx"
# Force binary mode transfer
option transfer binary
# Download file to the local directory d:\
get 211_AI_DR.zip.pgp D:\AIFiles\
# Disconnect
close

在日志文件的末尾,我看到进程正在完成

< 2015-12-22 09:47:48.893 Type: SSH_FXP_STATUS, Size: 30, Number: 5771525
. 2015-12-22 09:47:48.893 Preserving timestamp [2015-12-22T09:32:48.000Z]
. 2015-12-22 09:47:48.893 Transfer done: '/Home/Brokers Service Marketing Group/211_AI_DR.zip.pgp' [807259773]
> 2015-12-22 09:47:48.893 Script: close
. 2015-12-22 09:47:48.893 Closing connection.
. 2015-12-22 09:47:48.893 Sending special code: 12
. 2015-12-22 09:47:48.893 Sent EOF message

感谢大家给我指出正确的方向,我通过将 exit 添加到 SFTP_Download.txt 脚本中解决了这个问题。