Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a VPN into a client and I want schedule a batch file that will do some file copying to backup some data.

Problem is how do I automate to connect to the VPN if not connected and also unless I have accessed the mapped drive in explorer the batch file says can't find drive.

So I need to automate:

  1. Connect to VPN
  2. Make sure access to mapped drive ok
  3. Schedule batch file


EDIT: I am using the builtin VPN client for Windows Vista.

share|improve this question
It would help if you would explain the type of VPN you are using. – The How-To Geek Aug 25 '09 at 4:58

What VPN client are you using? How to automate it would depend on what system you are using.

As for automating the network drive connection you could use something similar to the following:

NET USE X: \\\sharename password /user:someuser

Just replace the details appropriately:

  • Replace X with whatever letter you want to map to
  • Change the IP address obviously ;-)
  • Replace sharename with whatever share you're wanting to backup to

You can leave off password and /user if you are connecting to an unprotected share.

Hope that helps.

share|improve this answer
I am using the builtin Windows Vista VPN, does that help? – user7818 Aug 25 '09 at 6:07
Use the command "rasdial" to start the connection to the VPN. – Snark Sep 8 '09 at 7:11

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.