Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Change settings of an existing dialer

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

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

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

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…
IT certifications are a concrete representation of continual learning on the part of the candidate.  Continual learning is necessary for the long term success of an IT professional, but are IT certifications the right path for you?
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

856 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