Remote Desktop via VPN

For many programmers and IT professionals, remote access via VPN to machines in their corporate network is a routine activity. This activity usually involves launching a VPN client (e.g. ShrewSoft VPN Client), entering a password, waiting for the VPN to be connected, then launching the remote desktop client. I have written a small executable to help automate that process, called DirectToDesktop.

The program launches your VPN client with the specified arguments and then starts a remote desktop session to a specified computer as soon as that machine can be pinged.

Usage

DirectToDesktop.exe <pathToVpnClient> <vpnClientArgs> <hostName> [pathToLookAlive]

<pathToVpnClient> – E.g. “C:\Program Files\ShrewSoft\VPN Client\ipsecc.exe”
<vpnClientArgs> – Args to pass to the VPN client.  E.g. “-r \”Your Company.pcf\””
<hostName> – The name/IP of the computer inside the VPN to remote desktop to.
[pathToLookAlive] – (optional) Install Look Alive to view connectivity status of the remote computer in the system tray.  E.g. “C:\Program Files (x86)\Zorn Software\Look Alive v1.24\LookAlive.exe”

Note: I’ve only tested the program with the built-in Windows 7 VPN client and ShrewSoft VPN Client, but in theory it should work with any VPN client that accepts command line arguments.

Installation
Just save DirectToDesktop.exe to any location on your hard disk, and add a shortcut to it using the above command line arguments. Run the executable without passing any arguments to view a help/about window.

Example Usage
After you have set up a VPN connection, you can use the following syntax if you are using either of the following clients:

Windows 7 VPN client:

directtodesktop.exe rasdial "Your VPN Profile Name" YourRemotePCNameOrIp

ShrewSoft VPN client:

directtodesktop.exe "C:\Program Files\ShrewSoft\VPN Client\ipsecc.exe" "-r \"Your Company.pcf\"" YourPCName

Comments are closed.