Automate Dial-Up connections


Q I read with great interest your August article on starting multiple programs with one batch file (Start multiple apps at once, p140). It was just what I needed to open Eudora, ICQ, and other applications without all the double-clicking. Now I'm wondering if I can make that same batch file open my Dial-Up Networking connection. I realise it would need a built-in delay to wait for the connection to be established - in my case, about 32 seconds (yes, I timed it).

- Doug Morgan

A Several other readers had similar questions. If you still use the DUN software that comes with Windows 95, the answer is no, you can't. But if you have DUN 1.2 or higher, you can connect to your Internet Service Provider in one click. That, combined with a simple DOS command, should solve all your problems.

To make your other Web-related applications wait until you've made the DUN connection, add the following line immediately below the line that launches your browser: choice /n /t:n,32 Continue waiting? The Choice command causes your system to pause and wait for a response. The /t switch tells the batch file to use the default choice ("n" in this example) after the specified number of seconds ("32" here). The prompt text ("Continue waiting?") is optional, and you can modify it to say whatever you want. Keep the DOS window out of your way by running the batch file in minimised form (choose Minimized from the Run menu on the Program tab of the batch file's Properties sheet).

The only thing this batch file doesn't do is shut down all the applications when you're done; you'll have to do that yourself, and then disconnect from your ISP by right-clicking the DUN icon on the taskbar and choosing Disconnect.

A few final tips - if DUN gives you a Connection Established dialogue box upon connecting, check Do not show this dialog box in the future and click Close. If you use Outlook Express for e-mail, you can make it automatically default to your inbox: Choose Tools-Options, click the General tab,check the box for When starting, go directly to my 'Inbox' folder, and click OK.

If you use IE 4.x (in Windows 9x or NT), you can easily automate your DUN connection. First launch IE. A dialogue box will prompt you to decide between connecting and working offline. Check the Connect automatically box and click Connect. The next time you launch your browser, it will automatically dial and connect for you. To combine this process with opening your other online utilities, just add a line launching your browser (for example, start c:\progra~1\ie\iexplore.exe) to the beginning of your batch file.

If you use some other browser, start by double-clicking My Computer and then double-clicking the Dial-Up Networking icon. Next, double-click the icon for the connection you want to automate (your ISP icon). Make sure that your user name and password are entered properly and that the Save password box is checked. Full automation requires these settings; without them, you'll be prompted for information every time you try to connect. If all the settings look good to you, click Cancel. Otherwise, click Connect. Once you connect, the settings will be saved, so you can disconnect immediately.

Now return to the Dial-Up Networking window. With the icon for your ISP still selected, choose Connections-Settings. Look for the Prompt for information before dialing check box. If you don't see it, you're using the old DUN, and you need to download and install the latest version.

Once you've installed the latest DUN software, return to the Dial-Up Networking window, select your ISP icon, and choose Connections-Settings. Uncheck Prompt for information before dialing and click OK. To simplify launching this connection from a command line, make a Shortcut: Using the right button, drag the ISP icon to a convenient folder (such as the Command folder in the Windows folder), and choose Create Shortcut(s) Here. Then modify your batch file to launch this Shortcut. If your ISP icon is named My_ISP, for example, add the command start My_ISP to the beginning of your batch file. (You should add the complete path if your Shortcut isn't on the desktop, in a Start menu, or in the Windows Command folder.)

- Scott Dunn


Category:win95
Issue: December 1998

These Web pages are produced by Australian PC World © 1998 IDG Communications