In article <[EMAIL PROTECTED]>, Derek Byrne wrote: > Hi, > Learning Perl from scratch at the moment, but not sure how I can go about > writing perl scripts in place of my existing batch scripts. > Below, is a working batch file.. what modules etc would I have to download > to get Perl to do the same thing? > Running Win2k and Perl 5.8. > > Céad Mile Fáilte, > DerekB > > @ECHO OFF >:: This will backup the Cash_Sheet folder in the store to the server >:: Setup Global Variables > set BUP_FOLDER=cash_sheet_backup > set DRVLTR=D: >:: Enter IP Address of the Remote PC to connect to > set CCPC_IP= >:: This is a simple backup process, copy all files from remote computer to > server >:: Delete old backup before doing so > if exist %DRVLTR%\%BUP_FOLDER% rd /s /q %DRVLTR%\%BUP_FOLDER% && ECHO > Removing Old Backup Folder > ECHO Creating New Folder : %DRVLTR%\%BUP_FOLDER% > ECHO. > md %DRVLTR%\%BUP_FOLDER% > cd /d %DRVLTR%\%BUP_FOLDER% >:: Map Z: Drive to the Remote Computer > net use z: /d > CLS > ECHO Mapping Drive to %CCPC_IP% > ECHO. > net use z: \\%CCPC_IP%\C$ > cd /d z:\cash_sheet >:: Test to see if the Cash Sheet log file exists, if it doesn't, we're in > the wrong place. Exit. > if not exist z:log.255 echo Cash Sheet Log File Doesn't Exist - Exiting && > goto END > ECHO Backing up Cash Sheet folder from %CCPC_IP% > xcopy *.* %DRVLTR% /S /Y /Q >:: If copying of files fails, errorlevel 4 is returned. Inform > Administrator and Exit. > if errorlevel 4 echo Errorlevel 4 - Files not copied && goto END > if errorlevel 0 echo All files Backed Up from %CCPC_IP% >:END > pause > nul >:: Remove all Temp Variables, setlocal can be used instead if preferred. > set BUP_FOLDER= > set DRVLTR= > set CCPC_IP= > c: > net use z: /d > > > ************************************************************************ > Meteor web site http://www.meteor.ie > ************************************************************************
-- . . . . . . . . . . . . . . . . . . . . . . . . . . . Mark Stosberg Principal Developer [EMAIL PROTECTED] Summersault, LLC 765-939-9301 ext 202 database driven websites . . . . . http://www.summersault.com/ . . . . . . . . -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]