Jan-Pascal van Best | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Location-Dependent Network Settings for Windows 95 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
This page describes how to set up a multiboot
environment for your laptop, so that network properties like IP address, DNS settings, NT
domain, computer name etc. can be set at boot time.
At the moment (note: this was written in October 1998), I live in the Shugakuin International House in Kyoto, Japan. I own a Toshiba laptop, model Satellite 300CDT, which I use both in the International House and in the Kyoto University Hospital, department of Medical Informatics. My girlfriend Ellen Jagtman also uses a laptop, an Acer Extensa 390CX. Hers is also used in the International House, as well as at the department of Civil Engineering of Kyoto University. At the dept. of Medical Informatics, I have a
direct Internet connection with a static IP address. I use Windows Networking, the
workgroup is Ae-room (whatever that means). At the faculty of Civil Engineering, Ellens
laptop is connected to a local network and logs on to an NT domain. She gets her IP
address etc. from a DHCP server. The local network is connected to the Internet by means
of a proxy server at 192.168.1.2. At home, we use a local IP network. We sometimes connect
to the Internet with a dial-up connection from Ellen's laptop. Then we run a proxy server
on Ellen's computer (WinGate) to
allow us to surf from both machines at the same time. The following table summarizes this
setup:
Everything except the HTTP Proxy is set in the Network Properties dialog (Start/Settings/Configuration Panel/Network). These settings are stored in the registry, a sort of internal Windows 95 database. The registry can be viewed, searched and edited with the regedit program (Start/Execute and type regedit). By the way, have you read the warning? Any changes you make are committed directly (there is no "Save" or "Save As"), so take care. By searching the registry (Edit/Search) for strings like "130.54.68.223", "Ae-room", or "gateway" you can find out where these settings are stored in the registry. In my case, the following registry keys hold the relevant data:
Please find out for yourself where the relevant settings are stored in your case. Probably, they are stored in about the same places as for me. We use Netscape Navigator 4.05 as webbrowser. Its preferences are set in the dialog you get when you select Edit/Preferences. These settings are stored in the file prefs.js in the directory C:\Program Files\Netscape\Communicator\default. Please examine this file to see. Make sure you know exactly where the differences between the two network environments are stored, then proceed to the next step.
When you select a registry key, you can extract it to a text file by choosing Registry/Export. You will be prompted for the name to save the information to. Please take the time to examine the resulting .reg file. As you will see, it contains all the registry information from the registry-"directory" you selected. If you want, you can delete the lines that are not relevant for your setup. Now, create two sets of .reg files, one set for each network environment. It is convenient, as we will see later, to use a naming system for these files. I used a two-letter code for each environment (MI, IH, and CE), to be used when the registry files are used at boot time. Because we will use them at boot time, it is also handy to make sure that the file names are DOS 8.3 compliant (at most 8 characters, then a dot . and the three-character extension reg). Store these files together in a directory, eg. C:\setup. Also store the two versions of the prefs.js file there. I created to following files:
Now that all the proper information for both network environments are available, the only thing you have to do is to make sure that the proper settings are used at boot time. For this you have to change the c:\config.sys and c:\autoexec.bat files. At the beginning of config.sys, before anything that is already there, you add something like:[menu] menudefault MI,4 menuitem MI,Medical Informatics menuitem IH,International House [MI] [IH] [common] REM -- put your original config.sys here -- Here, [menu] indicates the start of a boot menu. menudefault MI,4 means that, if you don't react to the menu within 4 seconds, the MI configuration will be chosen. Next come the two configurations. The first argument to menuitem is the symbolic name, the second is the name that is printed on screen to choose from. Next, the [MI] en [IH] sections are empty. This means that there are no special drivers that need to be loaded for these configurations. It is necessary to include the empty [MI] en [IH] section, you will get an error at boot time if you omit them. Then, the [common] section contains the drivers that have to be loaded for every configuration. In your case, these are all the drivers that were in your original config.sys. Somewhere in your autoexec.bat (I put it at the end), you add something like the following: regedit c:\setup\IDENT_%config%.reg regedit c:\setup\MSTCP_%config%.reg regedit c:\setup\LOGON_%config%.reg regedit c:\setup\TCPIP_%config%.reg copy c:\setup\prefs_%config%.js c:\progra~1\netscape\users\default\prefs.js The regedit commands insert the proper registry keys into the registry, so that when Windows starts, the proper IP address, DNS settings etc. are used. The %config% refers to the environment variable config, which is set by DOS according to what you choose from the boot menu. The copy command copies the proper Netscape preferences file to its usual place.
Exit and restart Windows. If everything goes well, you will be offered the choices you entered in the previous step. Use your computer is both environments and see if everything works well.
If you are happy to use this information, if you have any questions, if here is a much easier way to achieve this, please let me know at the following address: janpascal(at)vanbest.org.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|