Advertisement
Guest User

Untitled

a guest
Feb 14th, 2017
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  1. echo off
  2. SET winscp=C:"Program Files (x86)"WinSCPWinSCP.com
  3. SET stagingDirectory=\<staging path>
  4. SET scriptPath=\<ScriptPath>UploadScript.txt
  5. SET ftpHost=xx.xx.xx.xx
  6. SET ftpUser=user
  7. SET ftpPass=password
  8. SET fileName=Test.xlsx
  9. SET ftpFlags=
  10. @REM ftpFlags: -explicit
  11.  
  12. echo deleting uploadScript if it already exists
  13.  
  14. IF EXIST %scriptPath% del /F %scriptPath%
  15. IF EXIST %scriptPath% exit 1
  16.  
  17. echo Generating WINSCP Upload Script
  18.  
  19. >>%scriptPath% echo option batch abort
  20. >>%scriptPath% echo option confirm off
  21. >>%scriptPath% echo open sftp://%ftpUser%:%ftpPass%@%ftpHost% %ftpFlags%
  22. >>%scriptPath% echo option transfer binary
  23. >>%scriptPath% echo put %stagingDirectory%%fileName% /
  24. >>%scriptPath% echo close
  25. >>%scriptPath% echo exit
  26.  
  27. echo Launching WINSCP upload
  28.  
  29. start /wait %winscp% /console /script=%scriptPath%
  30.  
  31. %winscp% /log=\<ScriptPath>UploadScript.log /script=%scriptPath%
  32. exit /b %ERRORLEVEL%
  33.  
  34. set "winscp=C:Program Files (x86)WinSCPWinSCP.com"
  35. echo start "%winscp%"
  36. :: output: start "C:Program Files (x86)WinSCPWinSCP.com"
  37.  
  38. set winscp="C:Program Files (x86)WinSCPWinSCP.com"
  39. echo start %winscp%
  40. :: output: start "C:Program Files (x86)WinSCPWinSCP.com"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement