Guest User

Untitled

a guest
Jul 30th, 2016
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. @echo off
  2. if exist n:\home goto DISCONNECTME else goto CONNECTME
  3.  
  4. :CONNECTME
  5.  
  6. REM NOTE: in all of the below variables EXCEPT for mydrivename , double-quote the values!
  7.  
  8. REM This is the name of the VPN you've got set up
  9. set myvpnname="Name of your VPN connection"
  10.  
  11. REM Your LDAP username and password
  12. set myusername="username"
  13. set mypassword="password"
  14.  
  15. REM The name of your CIFS instance, to use for mapping the drive
  16. REM -- DO NOT QUOTE THIS VALUE!
  17. set mydrivename=cifs##.bravo
  18.  
  19. rasdial %myvpnname% %myusername% %mypassword%
  20. timeout 4
  21. net use n: "\\%mydrivename%\public" %mypassword% /user:%myusername% /persistent:no
  22. goto DONE
  23.  
  24. :DISCONNECTME
  25. net use n: /delete
  26. timeout 2
  27. rasdial %myvpnname% /d
  28. goto DONE
  29.  
  30. :DONE
  31. @echo on
Add Comment
Please, Sign In to add comment