Solved

Change settings of an existing dialer

Posted on 2000-04-04
5
155 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

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

Suggested Solutions

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…
An analysis of the phishing scam that has been affecting Google users, along with steps to take for protection, as well as what to do if you receive one of the emails.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), 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, fr…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

920 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

16 Experts available now in Live!

Get 1:1 Help Now