• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1796
  • Last Modified:

net use networked printers

I need to use a batch file so our networked users can connect to network printers.  They are currently mapped to network printers and I need to disconnect them from this particular server and reattach them to these same printers that located on a different server.
2 Solutions

create another batch file that maps the users to local printers.
Why don't you use something like mine....

net use f: /delete
net use f: "\\server\my documents"

net use y: /delete
net use y: \\server\zip

net use g: /delete
net use g: "\\mitchell\utilities"

net use lpt3 /delete
net use lpt3 \\server\canon

REM note double quotes for long share names
Try using a VBScript...

set net = CreateObject("Wscript.network")
use addwindowprinterconnection
and removeprinterconnection
and enumprinterconnection method (do a quick search on these key word and you'll find an exemple easily)

Here is the commands I have in my batch file to do exactly what you are asking for. I downloaded a program from the Zero Administration Kit called Con2Prt.exe.

con2prt.exe /f    'removes all printer connections
con2prt.exe /cd \\domain\sharename   'connects to printer and makes it default.
con2prt.exe /c \\domain\sharename 'just connects to printer.

I use this batch file to connect the computers in my network to multiple shared printers.  Just set the "d" parameter after the printer you want to default to.

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now