Thursday, April 12, 2007

RAS (Dial-Up) Tip/Trick for Auto dial

So, you want a dial-up connection to dial whenever a program "asks" for a remote resource (i.e. uses the internet)? Pretty standard - you goto the Internet Settings in the Control Panel, and look at the Connections tab. You should see any dial-up connection you have in the listbox, and below that the options you seek -- either "Always dial this connection" or "Dial this connection whenever a Network Connection is unavailable." I usually stick with the second option, since it seems more stable and reliable on the embedded systems I maintain.

This is all well and good, but I soon ran into a problem. After going through this setup, the first time you open an internet-savvy application and it attempts to use the remote resource, you'll be presented with a small dialog that lists the connection, has three buttons (Connect, Settings, and Work Offline) and also has a checkbox that is empty marked "Connect automatically." The problem is, the devices I'm engineering don't have a keyboard or mouse hooked up to them, and one of them is about 3 hours drive from here. So, the first time it drops the internet connection (which is dialed at startup fortunately) and these settings cause it to automatically connect again, it will throw this little dialog up on the screen and sit there - unaccessible to me since it is offline.

I used process monitor and my own development computer to (miraculously) narrow this down to one registry key. Interesting factoid: on my development laptop, Windows XP Pro hits the Registry (Mostly Reads fortunately) around 50 thousand times in the few second interval I captured using procman.exe! Here is the key:

[HKEY_CURRENT_USER\RemoteAccess\Profile\sprint] "AutoConnect"=dword:00000001

Oh, and make sure you change "sprint" to the name of your dial-up connection! [Thanks to KM from the XPE newsgroup for that reminder!] If the key exists, and is set to '1', it is equivalent to having checked "Automatically connect" in that annoying, useless dialog the first time.

Technorati Tags: , ,

No comments:

Disqus for A Nofsinger's Blog