FTP commands in a batch script does not working properly

前端 未结 2 1282
孤独总比滥情好
孤独总比滥情好 2020-12-20 01:23

I\'ve made a simple FTP upload script that should upload multiple files from a Windows 2008 Server to the FTP location. I\'ve tried this manually by executing every command

相关标签:
2条回答
  • 2020-12-20 01:59

    Place your script in a text file on your desktop called ftpscript.txt

    Create a batch file called getftp.bat and inside it have this - then you can click the bat file.

    @echo off
    ftp -i -s:"%userprofile%\desktop\ftpscript.txt"
    pause
    
    0 讨论(0)
  • 2020-12-20 02:06

    You can also try something like that with a batch file for multiple file Upload :

    MultipleFileUpload.bat

    @echo off
    Title Multiple file Upload by Hackoo
    mode con cols=85 lines=22 & Color A
    ::***********************************
    Set FTPSERVER=ftp.xx.xxx.xx.xx.com
    Set USER=UserName
    Set Password=YourPassword
    Set LocalFolder=X:\test\test
    Set RemoteFolder=/tempTest/tempTest/
    ::***********************************
    > ft.do echo Open %FTPSERVER%
    >> ft.do echo %USER%
    >> ft.do echo %Password%
    >> ft.do echo prompt n
    >> ft.do echo bin
    >> ft.do echo lcd %LocalFolder%
    >> ft.do echo cd %RemoteFolder%
    >> ft.do echo mput *.*
    >> ft.do echo bye
    ftp -s:ft.do
    del ft.do
    Pause
    
    0 讨论(0)
提交回复
热议问题