kuldietercastel Mar 2nd, 2013 51 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- REM send.bat
- REM Send all files from the inputDir directory to the outputDir directory of the given username .
- REM Description:
- REM This script has to be used with the pscp.exe of the putty suite.
- REM You can find putty here: http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html
- REM Version: 1.0
- REM Author: Dieter Castel
- REM License: Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License
- REM See: http://creativecommons.org/licenses/by-nc-sa/3.0/ for more info.
- REM Variables
- REM Changes where the files will be coppied to.
- set outputDir=/recieved
- REM Changes where the files will be coppied from.
- set inputDir=./toSend/*
- @echo off
- REM Asks for your user name.
- set /p user="Enter your ssh user name:"
- echo "Sending all files in %inputDir% to %email@example.com:/home/student/%user%%outputDir%"
- echo "Files with the same name will be OVERWRITTEN!!!!!!"
- echo "Press enter to continue or CRTL+C to exit."
- REM Uses putty copy
- REM -v for verbose messaging
- REM -r to copy all directories recursivly
- REM -2 force to use ssh2
- REM -scp use the scp protocol
- pscp -v -r -scp -2 -scp %inputDir% %firstname.lastname@example.org:/home/student/%user%%outputDir%
RAW Paste Data