Advertisement
kuldietercastel

send.bat

Mar 2nd, 2013
280
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. REM send.bat
  2. REM Send all files from the inputDir directory to the outputDir directory of the given username .
  3. REM
  4. REM Description:
  5. REM     This script has to be used with the pscp.exe of the putty suite.
  6. REM     You can find putty here: http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html
  7. REM
  8. REM Version:    1.0
  9. REM Author:     Dieter Castel
  10. REM License:    Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License
  11. REM             See: http://creativecommons.org/licenses/by-nc-sa/3.0/ for more info.
  12.  
  13. REM Variables
  14. REM     Changes where the files will be coppied to.
  15. set outputDir=/recieved
  16. REM     Changes where the files will be coppied from.
  17. set inputDir=./toSend/*
  18.  
  19. @echo off
  20. REM Asks for your user name.
  21. set /p user="Enter your ssh user name:"
  22. echo "Sending all files in %inputDir% to %user%@st.cs.kuleuven.be:/home/student/%user%%outputDir%"
  23. echo "Files with the same name will be OVERWRITTEN!!!!!!"
  24. echo "Press enter to continue or CRTL+C to exit."
  25. pause
  26. REM Uses putty copy
  27. REM -v for verbose messaging
  28. REM -r to copy all directories recursivly
  29. REM -2 force to use ssh2
  30. REM -scp use the scp protocol
  31. pscp -v -r -scp -2 -scp %inputDir% %user%@st.cs.kuleuven.be:/home/student/%user%%outputDir%
  32. pause
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement