Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- if exist n:\home goto DISCONNECTME else goto CONNECTME
- :CONNECTME
- REM NOTE: in all of the below variables EXCEPT for mydrivename , double-quote the values!
- REM This is the name of the VPN you've got set up
- set myvpnname="Name of your VPN connection"
- REM Your LDAP username and password
- set myusername="username"
- set mypassword="password"
- REM The name of your CIFS instance, to use for mapping the drive
- REM -- DO NOT QUOTE THIS VALUE!
- set mydrivename=cifs##.bravo
- rasdial %myvpnname% %myusername% %mypassword%
- timeout 4
- net use n: "\\%mydrivename%\public" %mypassword% /user:%myusername% /persistent:no
- goto DONE
- :DISCONNECTME
- net use n: /delete
- timeout 2
- rasdial %myvpnname% /d
- goto DONE
- :DONE
- @echo on
Add Comment
Please, Sign In to add comment