It seems that AddPrinterConne ction does not have the capacity to add a network printer to a remote pc. The alternative solution would be to utilise the rundll32 printui.dll,Pri ntUIEntry /? via DOS.
This commandline mechanism can be easily integrated into managed code in non-interactive mode.
Refer to Rick Strahl's blog:http://west-wind.com/weblog/posts/1440.aspx
Hope this is of some help.
User Profile
Collapse
-
WMI - AddPrinterConnection failing to add network printer
Hi guys,
have been playing with WMI to add a network printer connection to a Windows XP pc. My environment consists of a server running Windows Server 2003 and Visual Studio 2005 and a test pc running windows xp. Further, I have setup a full domain controller environment.
I have managed to write the code to add the network printer and it works fine when installing the printer on the same machine the code is executing...
No activity results to display
Show More
Leave a comment: