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

Printing Information

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

Notes on How to Change a Port Associated with a Printer Driver

Keywords: 	  port com lpt

Question:

How can I reload the registry without rebooting the machine in win95?

Also, how can I write a script that will change a port that is associated with a printer driver?

For example, lpt1: is connected to HP Laserjet 5/5m driver. I want to change the driver to com1: and have that change take effect without rebooting.

Answer:

The files that get updated when changing the port they are:
win.ini
system.dat
user.dat
that seems to be it.

Windows 95 seems to require not that the registry gets reset, but that whatever is changed by the registry gets reset. This said, I would look at resetting the ports and going from there.

When I make a port change, the following happens.

  1. Win.ini gets updated.
  2. Registry gets updated.
  3. For my laserjet 4MX, the file HPPCL.P00 gets updated.
  4. Because it is a com port involved, serial.vxd and serialui.dll get opened and closed.
for 3) and 4) above, you might need to do a series of dllCalls once you discover the functions within them that get run.

Let's be real careful. The registry is updated. The settings are changed.

Now if you want the various programs to pay attention to the newly installed registry settings, you must tell them. Generally you tell them via an wininichg message or a DMC message.

If you search the database for WININICHG= and DMC= then you can see how it is done.

The registry key got changed. Now the applications that process that information need to respond to the change. If they do not pay attention to the registry or pay attention when properly informed (that's the big trick - what is properly informed) then there is nothing anyone can do for the changes to take effect, aside from rebooting the machine.


Article ID:   W13684
Filename:   Changing a Port Associated with a Printer Driver.txt
File Created: 1999:04:15:16:55:40
Last Updated: 1999:04:15:16:55:40