Batch scripting

So my desktop is in Ghent, my “nas” is not.  My backup drive, a Lacie Internet Space with 1 TB is available trough my VPN. This is how I nowadays take my backup of my desktop, syncing 3 folders over the internet using a vpn, synctoy and some batch-scripting 😎 first an echo to show the options
followed by a choice (switch/case shizzle)
rasdial to establish the VPN
deleting previously mapped network drives
recreating the network drives
backing up using synctoy
shutdown 😀


@echo off
cls
echo 1. Met shutdown
echo 2. Zonder shutdown

choice /c:12
call :%errorlevel%
:1
echo metshutdown!
rasdial "MendelVPN" mendel
apassword
echo deleting
net use x: /delete
echo running synctoy!
net use y: "\\192.168.2.21\MijnBestanden\MijnFoto's" /user:mendel apassword
echo connected, backing up
"e:\SyncToy 2.1\SyncToyCmd.exe" -R "Pics BCKP"
echo succes!
net use y: /delete
rasdial "MendelVPN" /DISCONNECT
shutdown -s -t 300
goto :EOF
:2
do the same without shutdown

Advertenties
1 reactie

Geef een reactie

Vul je gegevens in of klik op een icoon om in te loggen.

WordPress.com logo

Je reageert onder je WordPress.com account. Log uit / Bijwerken )

Twitter-afbeelding

Je reageert onder je Twitter account. Log uit / Bijwerken )

Facebook foto

Je reageert onder je Facebook account. Log uit / Bijwerken )

Google+ photo

Je reageert onder je Google+ account. Log uit / Bijwerken )

Verbinden met %s

%d bloggers liken dit: