WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Modems and Dial-up Networking

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Running Dial-up Networking

Keywords: dial-up networking DUN 

Download a copy of our Internet Winsock extender, (from the WinBatch Add-Ons section of the download area of our website), and use the DUN... functions.

Alternatively, here's how to create a shortcut on the desktop and run that:

Go to My Computer, Dial-Up Networking, and create a short-cut on your desktop for your dial-up. Then right-click on the shortcut's icon to get Properties - Shortcut. With the cursor in the Shortcut key box, press some key combination, like Ctrl F12. The keys you press should appear as Ctrl + F12 in the box. Then apply the change.

Try it. Press Ctrl F12 when you have a blank screen. It should start your dial-up running. If it does, then you can start your dial-up from a Winbatch script like this:

	SendKeysTo("","^{F12}")
In other words, you have Winbatch send Ctrl F12 to the desktop.

Question:

What is the default time that DunConnect waits to establish a connection and how can I change it so that I can display a message if a connection is not made after a certain time. I'd rather not have to wait with uncertainty while the connection is being attempted. If there is a failure I sometimes have to wait several minutes for an error message. If it is not possible to control connect timeout, is it possible to abort the connection with a line of code or even manually. Thanks in advance.

Answer:

I looked at the code. It disappears into Win95/NT RAS dial up networking fairly quickly. Did not see any way to influence the time or how to cancel it.

This code will also connect....

How to run a shortcut link using WinBatch:

        ;;Create a link to the dial-up networking window.

        ;------------------------------------

        mylink = "c:\win95\desktop\mynet.lnk"

        ;------------------------------------

        ShellExecute(mylink, "", "", @NORMAL, "")
        WinWaitExist("Connect To",-1))

        SendKeysto("Connect To","~")

        WinWaitClose("Connect To")


ShellExecute doesn't wait for the application, so that's why you need to add the While loop. In Winbatch 96E and later versions, you could use the WinWaitExist function instead of the While loop, to check for the "Connect To" window to come up. That part of the code would look like (after the ShellExecute line):
WinWaitExist("Connect To", 10)

If Dialup Networking is not working the same on all machines, things to check are:

  1. In Dialup Networking, check all options in the Properties of the Dialup Networking options as well as the Connections/Settings options. Look at the option about whether or not the dialog box comes up (the one we're sending an ENTER key to).
  2. Is ShellExecute is failing? Or ShellExecute is working but WinBatch doesn't see the window coming up?
  3. The problem could be that the path to LNK file is not quite right.
  4. Or, there could be a long or short file name problem with LNK file. ShellExecute should work with short or long file name, but you might experiment with one or the other.

Question:

In NT, you can type multiple phone numbers to each DUN entry. In W95, you can type only one. I first intended to bring up the DUN connect dialogue, use WBT to sendKeysTo() the phone number and press the Connect button. Then the WBT monitors the dialogues to see if the connection goes through. If not, it would press cancel and try another number. It failed at the first step. Anyone knows how I can bring up the "Connect to" dialogue in the first place? The DUN* functions in the Internet Extender explicitly bypass the dialogue. While I can right click the item when I open the Dial Up Networking folder, I can't find out what the connect popup-menu item is doing, or try to do what it is doing. I am now considering creating a separate DUN entry for each phone number. It gives rise to more redunduncy, at least I have to set the password once in each entry, and it may confuse my other WBTs because now the DUN connection has a different name from time to time. Any ideas or suggestions?

Answer:

You can open the Connect to dialog with:
	Run("%WPath%rundll.exe","rnaui.dll,RnaDial %Name%")
where %WPath% is the Windows path and %Name% is the connectoid. Case and punctuation are important. (There is a space before the connectoid name.)

Question (cont'd):

Thanks. I am testing. Are quotes required? When the connect-to-ID has spaces?

BTW, in the past, I can create a folder under the start folder called "DUN.{992CFFA0-F557-101A-88EC-00DD010CCC48}" and have the Dial up connections listed there. I found that after install IE4, this stopped to be effective. The folder created is always empty. Do you have any idea why?

Answer:

The RUNDLL function takes a comma delimited list of parameters. So a space in a parameter should not horrible confuse it (I think).

I'm not sure what IE4 does, but I think it installs a different (OSR2) version of Dialup networking.


Article ID:   W13291
Filename:   Running Dial-up Networking.txt
File Created: 1999:04:15:16:53:02
Last Updated: 1999:04:15:16:53:02