[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 182
  • Last Modified:

Change settings of an existing dialer

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
itailevitan
Asked:
itailevitan
  • 2
  • 2
1 Solution
 
jhanceCommented:
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
 
pabgilanCommented:
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
 
jhanceCommented:
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
 
pabgilanCommented:
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
 
itailevitanAuthor Commented:
Thank-you both very much!
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now