• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 118
  • Last Modified:

Any Registry Experts here?

Hi,

I am trying to script dial-up connections and I would like to know if there is a registry key that states whether a connection has been made successful or not. Example: When a connection is made a network connection icon appears in the task bar. Does anybody know the registry key for this? And or does anybody know how I can use a script to determine whether a connection has been successful or not.

I have tried using regmon to find the reg keys changed when a dial-up connection is made without any success.

The only other key that I have found which changes when dial-up connections are made is one for the modem status. When the modem is active ie dialling or connection made and in use the registry key changes from a 0 to a 1. I could use this key for scripting but it changes even when the modem is dialling so I am not sure exactly how I can sue this key to my advantage.

Any help would be much appreciated.

Mick
0
MickEv
Asked:
MickEv
  • 2
  • 2
1 Solution
 
hendrik999Commented:
It's maybe easier to use rasdial.exe in a command (cmd) script and check the errorlevel of rasdial.
With rasdial you can dial DialUp Connections easily.
See rasdial /? for more info.

Create a file called e.g. dialup.cmd
An example dialup.cmd would be:

=========================
@Echo off
rasdial TestDialup myusername mypassword
if %errorlevel% == 0 goto SUCCESS
echo Connection NOT successfull
goto END

:SUCCESS
echo Connection successfull

:END
=========================

Hope this helps.
0
 
MickEvAuthor Commented:
Thanks for the info. I actually use rasdial but for some reason didn't think about trying to trap errorlevels returned - silly me.

Anyway I am now able to achieve what I was trying to do.

Thanks,

Mick
0
 
MickEvAuthor Commented:
Easy points for you! :)
0
 
hendrik999Commented:
Glad it works, thanks for the 'easy' points.
0

Featured Post

[Webinar On Demand] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now