Kent,

Thanks for the welcome. The reason I have asked this question is because I am trying to get around a problem we have in our NT4 domain. Take a look at Microsofts KB article - Disconnecting Network Printer Leaves Registry Settings (Q188697). I have also found that the subkeys from the HKLM\System\CurrentControlSet\Control\Print\Environments\Windows NT x86\Drivers\Version-2 key need to be removed as well to make this work.What I want to do create a script that will do this automatically.

The main reason for doing this is because we have recently upgraded our servers to Win2KAS and hence upgraded our printer drivers. As the KB article says, the settings from the older drivers are left in the NTUser.dat and the driver info is left in HKLM. We have a lot of people who aren't able to print properly because of this.

What needs to be done is:
1. note all printer connections (including default)
2. stop the spooler service
3. remove the printers
4. remove relevant registry keys
5. start the spooler service
6. re add the printers noted in step 1.

As you can see AddPrinterConnection to a remote PC would come in really handy in this case.

Can you see any other way around this problem?

TIA

David.
_________________________
regards David ----------------------------------- Life wasn't meant to be easy.... But it wasn't meant to this hard! -----------------------------------