Tech Support Forum banner
Status
Not open for further replies.
1 - 8 of 8 Posts

·
Registered
Joined
·
10 Posts
Discussion Starter · #1 ·
Hi All

I had a question in (here if you're interested, but no need to read in order to answer this question) in which I outlined my difficulties in having to daily reinstall my wireless broadband card.

It didn't surprise me much that no one had an answer - it is after all a card/network few of you would have encountered.

Anyway, I discovered that I could get by with simply deleting the "dial up" connection out of "Network Connections" and when I inserted my card a new one would be created (i.e. I didn't need to reinstall all the associated software).

That's a tolerable work-around, except for one thing: In order to operate VPN and also browse the net (essential to get my emails) I have to alter one of the default settings in the "dial up" connection each time it's created.

The path is:
  1. Right-click on the connection
  2. Properties
  3. Click on 'Networking' tab
  4. Click on 'Internet Protocol (TCP/IP)'
  5. Click 'Properties' button
  6. Click 'Advanced' button
  7. Uncheck 'Use default gateway on remote network'
  8. Click OK (three times)

Now, this is quite a hassle, as you can imagine. Can anyone suggest a way this value can be found and updated directly (in the registry?) Ideally, I'd like to end up with an icon that I can double-click to make the change.
 

·
Registered
Joined
·
171 Posts
I'm not sure how to do it in the registry, but if you want I could code a macro to do the job for you. All you'd need to do is double click on a program and it'd do all the work for you. However, this wouldn't be the simplest thing to program and it'd just mirror your mouse movements. You'd still need to wait for it to finish as if you did it yourself, but it would move a lot faster. This makes it more of a temporary work-around rather than a permanent solution.
 

·
Microsoft MVP
Joined
·
3,339 Posts
You need to edit the rasphone.pbk file located here:
C:\Documents and Settings\All Users\Application Data\Microsoft\Network\Connections\Pbk

Find the entry IpPrioritizeRemote=X in the section with the name of the Dial-up connection, and set it equal to 0 instead of 1.

If you always create the Dial-up connection with the exact same name, you can just set it once and then use a batch to overwrite it from a "master" copy.
Otherwise, you'd need to read in each line and output them to a new file, changing that one line, then delete the original and rename the new one.
This will do just that, as long as the file doesn't contain any of these characters:
!^&<>|
It shouldn't, unless it's in the description of the card.
This will remove all blank lines from the file, but that shouldn't be a problem. If it is, it can be modified to leave them in.
Code:
@Echo Off
SetLocal EnableDelayedExpansion
PushD %ALLUSERSPROFILE%\Application Data\Microsoft\Network\Connections\Pbk
Set _FileName=rasphone
If Exist %_FileName%.tmp Del /F /Q %_FileName%.tmp
For /F "Tokens=1 delims=" %%I In (%_FileName%.pbk) Do (
Set _Temp="%%I"
If /I "!_Temp:~1,18!"=="IpPrioritizeRemote" (
>>%_FileName%.tmp Echo.IpPrioritizeRemote=0
) Else (
>>%_FileName%.tmp Echo.%%I
))
If Exist %_FileName%.pbk Del /F /Q %_FileName%.pbk
Ren %_FileName%.tmp %_FileName%.pbk
PopD
EndLocal
HTH

Jerry
 

·
Registered
Joined
·
10 Posts
Discussion Starter · #5 ·
You need to edit the rasphone.pbk file ...
Thanks Jerry. That's exactly what I was looking for.

There are three sets of definitions in that file, the "dialup" for the wireless card and two VPN definitions for two different clients I dial into. Since all three should have the value set to '0', I think your batch file will be ideal.

In fact, it may even help me to debug the underlying problem. Since deleting the connection and letting the card insertion create a new one always fixes the problem, it's reasonable to assume that it's something in that definition that gets corrupted.

When I thought it was registry-based, I had done a "regshot" before and after deleting/recreating the connection, but it didn't show anything interesting being changed. Perhaps I can compare the rasphone file when it's newly created and after the problem occurs to see if it's one of those lines being screwed up.

I'll post back with my results.

Thanks again.
 

·
Registered
Joined
·
10 Posts
Discussion Starter · #6 ·
I'll post back with my results.
The card is inexplicably working now - i.e. not requiring re-installation for every new session.

I installed a file comparison utility (WinMerge), then took a copy of rasphone.pbk and did my usual reinstall.

There were a number of differences, but nothing that leapt out as the obvious answer, so I set about "merging" them back - doing the first half initially (process of elimination), then when that didn't fix it, the second half (just to prove that it really was something in rasphone.pbk).

Sure enough it started working again after merging the second half, so I was intending to split the second half of the parameters in half again, but after disconnecting and reconnecting, the files had no differences, and haven't had any in the several reconnects since then (including a reboot).

It's as if the action of merging (i.e. pushing the values from the copy into the original) has somehow stabilized it.

I still have a printed copy of the differences.

Fingers crossed that it'll stay good, but if it doesn't I have a plan and the tools to analyse it.
 

·
Registered
Joined
·
1 Posts
I am looking for something like this that I can put on my users desktops. I have users that need a static IP address when they are on location. When they come back to the offic e they need to switch back to Obtain IP address automatically. I was looking for a batch file or macro. Could you suggesat something for me to start with? I will try to create it myself. I just don't lknow the correct syntax Thanks
 

·
Microsoft MVP
Joined
·
3,339 Posts
If they reboot their PCs rather than use hibernation or sleep, and are running XP, one option is to create different hardware profiles, they then choose one during boot.

Otherwise look into the netsh commands, netsh interface ip set address in particular
XP Command Line Reference - N
Netsh Command Overview for Windows Vista/2K3/2K8

This is really quite different than modifying a dial-up configuration file, so best to start a new thread if you have further questions.
 
1 - 8 of 8 Posts
Status
Not open for further replies.
Top