Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I've been using "net use" successfully to connect to shared drives on my network with Windows 7. Now, I am trying to connect a Windows 7 computer to a shared printer on a windows 7.

So, on the client computer I've done through it the GUI to see everything works properly. Than, I disconnected the printer and tried using the command line to do the same thing like this:

net use \\FRONTPC\FCPrinter 

it says:

The command completed successfuly.

However I don't see the printer under "Devices and Printers". So, where is the printer? What am I doing wrong?

share|improve this question

1 Answer 1

up vote 3 down vote accepted

From ss64:

"NET USE command can map a network printer to an LPT port (for DOS type applications that print to a port.) but this does not add the printer to the Control Panel GUI."


If you're limited to using cmd, you might want to use Rundll32 printui.dll,PrintUIEntry.

If you can use PowerShell, you can do something like this:

$prnt = [wmiclass]"Win32_Printer"
$prnt.AddPrinterConnection("\\PrintServer\PrintShare")

share|improve this answer
    
thanks, that looks useful, but I'm still not getting the awkward syntax of the printui.dll command... can you explain? –  Oz123 Dec 8 '11 at 20:29
2  
Something like RUNDLL32 PRINTUI.DLL,PrintUIEntry /ga /n\\PrintServer\PrintShare should work. There's a good outline with examples here –  MDMarra Dec 8 '11 at 20:44
    
I managed to "add" the printer using powershell. However... The print test page fails ... And, I know it works using the gui... So there is still one more step missing...Maybe it's the driver ? –  Oz123 Dec 8 '11 at 20:56
    
@Oz123 I have that exact code in a larger script that successfully maps printers for hundreds of computers without issue. –  MDMarra Dec 8 '11 at 20:58
    
I guess it is is a driver issue ... On another printer the return code was 0, so the printer did succeed with printing a test page. However with the faulty printer the error code was 1797... –  Oz123 Dec 8 '11 at 21:03

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.