Configure Phone and Modem Options with script

Posted on 2011-03-01
Last Modified: 2012-08-14
Hey guys,

I have a bulk deployment to reconfigure PC's modem settings for some wireless aircards we have in circulation. Essentially what currently needs to take place is the following:

Configure "Modem Properties > Advanced > > Extra Settings > Extra initialisation commands" to equal "at+cgdcont=1,"IP","domain.<cec>.<ou>.<ou>""

I would like to create a script that can do this, however, there is a lack of consistancy with these aircards, thus I believe there needs to be an user input option to select the type of modem before kicking it off (unless they are tracked by sequential number)

I want this to be run on the local machine, as the aircard needs to be plugged in to configure the properties.

Sorry this is a curley one, hope someone can help.

Question by:G_M
  • 4
  • 3

Expert Comment

ID: 35013726
If you're trying to do this through the GUI and require user input you could try AutoIT.  It's got an easy learning curve and is pretty flexible.
LVL 15

Accepted Solution

WalkaboutTigger earned 500 total points
ID: 35013744
Step one:  Find the area in HKLM where the modem type is defined - maybe SYSTEM\CurrentControlSet\Control\Class
Step two: Perform a RegKeyExists for each of the aircard types.  When one succeeds, that is the type of card installed.
Step three: Write the registry entries for the appropriate card type.

If you can get the specific class entries for the cards, I can put a script together for you fairly quickly.

Assisted Solution

G_M earned 0 total points
ID: 35014236
Registry changes it is. Thanks for making me think outside the box a little.

This is what I came up with:

pushd C:\Temp
reg query HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Class\{4D36E96D-E325-11CE-BFC1-08002BE10318}\0001
if not errorlevel 1 (
   regedit /s Aircard1.reg
) else (
   echo "Device 1 Not Found"
reg query HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Class\{4D36E96D-E325-11CE-BFC1-08002BE10318}\0002
if not errorlevel 1 (
   regedit /s Aircard2.reg
) else (
   echo "Device 2 Not Found"

Open in new window

LVL 15

Expert Comment

ID: 35014249
Any particular reason you're reading ControlSet001 and not CurrentControlSet?

Just curious,,,
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

LVL 15

Expert Comment

ID: 35014263
I think that all you need to do to accept the answer is go to the appropriate answer and, on the blue bar, select the link indicating this is the solution.

Author Comment

ID: 35014364
I actually had to address three strings I found in the registry


Not 100% sure what the differences are but it works... the script only writes to them if they exist.
LVL 15

Expert Comment

ID: 35014387
OK - you really should only need to change CurrentControlSet as this is the "live" one.
It is also much safer to only change this one.

Author Closing Comment

ID: 35045720
My solution is  WalkaboutTigger's theory in practice

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is pretty cool.  The purpose of this VB Script is to help you document where JAR (Java ARchive) files and specifically java class files are located so that you can address issues seen with a client or that you can speak intelligently with a dev…
Over the years I have built up my own little library of code snippets that I refer to when programming or writing a script.  Many of these have come from the web or adaptations from snippets I find on the Web.  Periodically I add to them when I come…
Internet Business Fax to Email Made Easy - With  eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now