Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/windows/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用WinSCP在Windows上计划自动FTP上载_Windows_Scheduled Tasks_Winscp - Fatal编程技术网

使用WinSCP在Windows上计划自动FTP上载

使用WinSCP在Windows上计划自动FTP上载,windows,scheduled-tasks,winscp,Windows,Scheduled Tasks,Winscp,让我先声明一下,我从未在WinSCP的UI上执行过脚本 我在服务器上有一个程序,它生成一个文本文件,我想将该文件发送到我们组织的共享驱动器。在浏览互联网时,我发现了一些解决方案,如下面的代码。(由于明显的原因,凭证被遗漏) 然后将其保存为.txt(abc.txt) 然后手动执行为winscp.com/script=abc.txt 这不是我想要的,因为我认为整个目的是实现自动化。此外,实际上只需要发送一个文件,而不是目录中的所有文件。正如我上面所说,我在这方面的知识是缺乏的,所以我为任何错误的沟通

让我先声明一下,我从未在WinSCP的UI上执行过脚本

我在服务器上有一个程序,它生成一个文本文件,我想将该文件发送到我们组织的共享驱动器。在浏览互联网时,我发现了一些解决方案,如下面的代码。(由于明显的原因,凭证被遗漏)

然后将其保存为
.txt
abc.txt

然后手动执行为
winscp.com/script=abc.txt

这不是我想要的,因为我认为整个目的是实现自动化。此外,实际上只需要发送一个文件,而不是目录中的所有文件。正如我上面所说,我在这方面的知识是缺乏的,所以我为任何错误的沟通道歉

谢谢,, Joshua Averbuch

首先,请参阅

使用WinSCP将文件上载到FTP服务器的简单批处理文件(
upload.bat
)如下所示:

winscp.com /log=c:\path\ftp.log /command ^
    "open ftp://user:password@example.com/" ^
    "put ""U:\DO Unitization\Team Member Folders\xxxxxxxx\file.txt"" ""/remote/path/""" ^
    "exit"
你可以把这个给你


对于调度,只需使用Windows调度程序即可。
有关详细信息,请参阅另一个



类似的下载:

谢谢,这正是我需要的
winscp.com /log=c:\path\ftp.log /command ^
    "open ftp://user:password@example.com/" ^
    "put ""U:\DO Unitization\Team Member Folders\xxxxxxxx\file.txt"" ""/remote/path/""" ^
    "exit"