Vbscript remove network printer windows 7




















It explicitly mentions that objNetwork. RemovePrinterConnection strPrinter will work only on the local computer. You need to use objPrinter. Ansgar-Wiechers : Thanks for the information. You are right in that it only works on the local computer and that is exactly what I am trying to get by. Right now objPrinter. So it does not matter if I replace objNetwork. RemovePrinterConnection with objPrinter. I have now updated the code snippet in the question and removed a misleading part.

Can you enumerate any printers at all? Echo objPrinter. Network : Next? It seems the user who is running the script doesn't have any network printers mapped, so there's nothing to remove.

Show 6 more comments. Active Oldest Votes. ExecQuery qry If driver. Improve this answer. Ansgar Wiechers Ansgar Wiechers k 23 23 gold badges silver badges bronze badges. Perfect, this seems like the solution, thanks! I will mark the answer as the solution as soon as I have tested it — Plarsen.

I just want to remove two printers that were previously installed via a logon script. They have been replaced, but the networked printer now needs to be removed from the clients. CreateObject "WScript. RemovePrinterConnection PrinterPath, true, true. However, if you want to remove a specific printer that is installed on the client machine, you could use the following one:. I ended up doing it manually at each workstation. Windows Client. Sign in. United States English.

Ask a question. Quick access. Search related threads. Remove From My Forums. Answered by:. Archived Forums. Windows 7 Networking. Sign in to vote. Thanks in advance After some research i figured out that the printers that would still not get uninstalled, had jobs waiting in the spooler queue, but since the server was no longer accessible, the jobs would never complete.

I opted for a simple solution and added to the script the following. If fail on vbs and printui. This removed all the last remains of the printers. Hope it helps someone else, if You need the actual finished script, let me know.

Just starting our own migration from Novell to AD and can see that your scripts could come in very handy. However if you give me some more information on what you plan to do during the migration and how you will execute the script on the machines, I can give You some different snippets to use. Ill send You an e-mail as well for contact. That was by trial and error I found that dl is usually for local and dn for network, but in this case it appears as local even if its a network printer.



0コメント

  • 1000 / 1000