Solved

Change settings of an existing dialer

Posted on 2000-04-04
5
158 Views
Last Modified: 2010-04-13
I would like to run a procedure that will change the DNS settings of an existing dialer. Running an ins file will create a new dialer and I don't want that. Can u help?
0
Comment
Question by:itailevitan
  • 2
  • 2
5 Comments
 
LVL 32

Expert Comment

by:jhance
ID: 2683968
There is an programming interface that can either create a new dialup connection or edit an existing one.

In particular the RasSetEntryProperties function does the job.  Unfortunately, I've not seen an application that does the specific task you are looking for.  It's somewhat specialized.

I've written similar custon programs for clients who needed to make a global change to some DUN connection settings across their entire user base.  Not a difficult prospect but beyond the scope (in my opinion at least) of a 77 pt. Experts Exchange question.
0
 
LVL 1

Accepted Solution

by:
pabgilan earned 77 total points
ID: 2695833
All the settings for each DUN connection are stored in a plain text ASCII file like in NT4. This file is called rasphone.pbk and it's located in a folder inside W:\Documents and Settings\ (W is the drive on which you have W2K installed). This folder is not the same on each machine (depends on language, etc) but you can locate the file making a dir *.pbk /s from that directory.

You can make your own program for editing that file, or use standard command-line text replacement tools.

Programming with Delphi, you can use the Inifiles unit to read and write text easily in that file (that file is exactly like an .ini file). I have made my own time-counter for my DUN connections, and my program reads the name of all the connections from that file.

Regards
0
 
LVL 32

Expert Comment

by:jhance
ID: 2696001
It's very dangerous to use an undocumented file format (like the RASPHONE.PBK) when an API exists that does the same thing.  The format and/or location of this file can be changed at any time.  There is also no assurance that this file will even continue to exist.  Take Win9x for instance.  If you had an app that used RasSetEntryProperties, it would work on Win9x, NT, and still work on W2K.  If you were using the pbk file, it would have worked on NT4 but now be broken on W2K since the location (but not the format) has changed.  

Who knows what might happen to it in the future?


RasSetEntryProperties is the "right" way to make changes to RAS phonebook entries.  Maybe DELPHI is too limited to directly access WIN32 API functions but that's a good reason to drop it and use something else.
0
 
LVL 1

Expert Comment

by:pabgilan
ID: 2696291
I suggested accessing the rasphone.pbk file because it's easier than accesing RAS API for doing this. Of course, working with these functions, like RasSetEntryProperties, is a better way to solve the problem, but it needs more advanced programming skills.

Of course, Delphi can access the RAS API functions; I normally use these system calls in my programs, but one day I needed to write a small program in five minutes (only intended for personal use) to getting the name of the dialers, and reading that file is a quick way to get the names and properties of all the dialers.
0
 

Author Comment

by:itailevitan
ID: 2697518
Thank-you both very much!
0

Featured Post

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Windows 2000 Kerberos problem 5 321
Making a spare domain pc 12 325
VMware converter for windows 2000 server SP4 4 6,042
Cannot Upgrade Microsoft Installer on Windows 2000 29 63
NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
When you have clients or friends from around the world, it becomes a challenge to arrange a meeting or effectively manage your time. This is where Outlook's capability to show 2 time zones in one calendar comes in handy.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

777 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