批处理文件无法使用Windows任务计划程序正确运行

时间:2016-03-09 13:07:28

标签: windows batch-file

我有一个批处理文件,它将执行以下操作

  • 将example.csv文件编码从ansi转换为utf8编码
  • 压缩example.csv文件并将内容移动到zip文件example.zip文件夹。 example.csv将不再在路径中可用
  • 将zip文件夹example.zip传输到sftp服务器。

当我手动运行批处理文件(双击批处理文件)时,上述操作表现良好且符合预期。

当我通过任务计划程序运行批处理文件时,

  • utf8编码正常发生
  • 22bytes example.zip文件正在转移到sftp服务器。当我提取文件时,它没有文件example.csv中的文件example.csv。

有人有想法解决这个问题吗?谢谢

批处理文件内容如下:

@echo off

PowerShell.exe -Command "& 'D:\PeopleData\META\Scripts\encode_to_utf8.ps1'"

echo The program will wait 20 seconds before continuting, interrupted by the user
timeout /t 20

cscript.exe D:\PeopleData\META\Scripts\compress_csv.vbs"

echo The program will wait 100 seconds before continuting, interrupted by the user
timeout /t 100

START D:\PROGRA~2\WinSCP\winscp.exe /console /script=D:\PeopleData\META\Scripts\Itsm_to_sftp.txt

Exit

0 个答案:

没有答案
相关问题