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
echo 1. Met shutdown
echo 2. Zonder shutdown

choice /c:12
call :%errorlevel%
echo metshutdown!
rasdial "MendelVPN" mendel
echo deleting
net use x: /delete
echo running synctoy!
net use y: "\\\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
do the same without shutdown

1 reactie

Geef een reactie

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

Je reageert onder je account. Log uit /  Bijwerken )

Google+ photo

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


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

Facebook foto

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


Verbinden met %s

%d bloggers liken dit: