views:

32

answers:

4

I am working on a windows service that requires a specific VPN connection.

My problem is that the solution provided by the customer (Rainbow iKey usb stick) requires the user to enter a pin code for each time the VPN connection is initiated. This will happen at least every night, when there is a maintenance window.

As this is a windows service and intended to run in a server environment, I can't rely on people punching in the PIN code every morning.

I need to detect when the "Token login" appears and pass the correct pin code - is it doable?

A: 

If you use a shell script for invoking the VPN, you can use SendKeys.

The success of SendKeys will depend a lot on how the iKey implements its prompt. So good luck.

Will
Thanks, but the VPN is set up by means of a cisco router. The PIN prompt appears as a pop-up window from a separate application.
snaits
A: 

Turns out there exists an SDK for this usb key. However, it's not publicly available and it was not until I had spent some days emailing the provider that they gave me a link to the SDK along with a trial license.

Only drawback is that the SDK is a C++ 6.0 dll.

snaits
A: 

There is a tool named AutoIt which possibly can do the trick. I'm not experienced with Autoit, but you can automate such things with it: Wait for a specific window to appear, type text, click buttons.

ur
A: 

AutoHotKey is a freeware tool that might help you. It's primarily meant for writing scripts that you can bind to keys on the keyboard (hence the name), but its scripting language is pretty flexible. I've used it to write scripts that sit in the background, waiting for a particular window to appear, and then automatically interact with that window for me -- which sounds like exactly what you need (if the dialog isn't hardened against programmatic manipulation as Hans theorized).

Joe White