Discussion Locked

How to remove printers in script?

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Running Win2000 Terminal Services we've used a script like this to add three printers to users that log on:

Set WshNetwork = CreateObject("WScript.Network")
PrinterPath = "\\Server\Printer"
PrinterDriver = "PrinterDriver"
WshNetwork.AddWindowsPrinterConnection PrinterPath, PrinterDriver

Now, how on earth do I delete one of the printers from their profiles, using a login script?
The removeprinterconnection method doesn't work, cause the printers aren't mapped to a local port I guess...

5 replies

by it-sage (bschirf)

I'm not sure how to do this on Win2000 Terminal Services, but on our NT4 systems we use the Con2Prt utility. (See TechNet Q181663)

We placed Con2Prt in the Netlogon share and issued the following command in the login script:
con2prt /f > nulcon2prt /c \\prtserver\printer1 con2prt /c \\prtserver\printer2

The first line removes all printers, the next two adds printers.

HTHs...

by it-sage (bschirf)

I'm not sure how to do this on Win2000 Terminal Services, but on our NT4 systems we use the Con2Prt utility. (See TechNet Q181663)

We placed Con2Prt in the Netlogon share and issued the following command in the login script:
con2prt /f > nulcon2prt /c \\prtserver\printer1 con2prt /c \\prtserver\printer2

The first line removes all printers, the next two adds printers.

HTHs...

This discussion is closed to new replies.