• Auto Connect VPN Batch

    11/01/2014 at 17:59 0 comments

    General Information

    Today I was working on WSUS and email notifications for Event Viewer errors when I received a call from a client that had to switch to an older PC running Windows 7 Pro which does not allow for the Direct Access VPN that they currently are using on Windows 8.1 Enterprise. I needed a way to auto connect the VPN similar to the way DA works on Enterprise. There is a lot of information out there about how to auto connect a VPN connection and none seemed to work except for this simple batch file. You don't really need to know much about batch files or how to write code. I hope this information will help you and if you would like more information about new and timesaving batch file or PowerShell scripts please follow my blog and I will update as often as I can. Instructions and sample batch below.

    IAS

    Change VPN Connection settings

    1. On the VPN Connect screen, check "Save this user name and password for the following users"
    2. Select the "Anyone who uses this computer" radio button
    3. Click "Properties"
    4. Then click on the "Options" tab and uncheck both: Display progress while connecting and Prompt for name and password, certificate,etc.

    Batch to insert into Startup folder

    rasdial "VPN CONNECTION NAME"
    start c:\drives.bat (To run login.bat automatically after the VPN connection is established)
    start c:\spark.bat (add simple batch files to run other programs during startup)
    exit