Solved

Change settings of an existing dialer

Posted on 2000-04-04
5
151 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Thank-you both very much!
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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…
In this step by step tutorial with screenshots, we will show you HOW TO: Enable SSH Remote Access on a VMware vSphere Hypervisor 6.5 (ESXi 6.5). This is important if you need to enable SSH remote access for additional troubleshooting of the ESXi hos…
This video discusses moving either the default database or any database to a new volume.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

772 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

14 Experts available now in Live!

Get 1:1 Help Now