Link to home
Start Free TrialLog in
Avatar of dr_binks
dr_binks

asked on

network printers

Hi,

I am currently writting a "universal" logon script, which detects which gorup the user is in and sets up their stuff accordingly.. unlike my old method of writting
a script for each user.

Anyways, I want to start managing the network printers now by setting the shares using this script. However the printers here are not connected to a computer, but connected via ethernet to the network...

Is there a way I can still map these printers?

I have had a look at this zero admin resource kit.. and it says its for NT4.0 so does XP/win2k3 have the means to do this? If not, can I just copy the con2prt.exe file into the netlogon folder (like I did with the ifmember.exe file, according to M$ this will work).

I have also tried stuff like:
Net Use \\IPofPrinter
Net Use \\IPofPrinter\blah

which obvously didnt work

Cheers

~Binks
Avatar of scampgb
scampgb
Flag of United Kingdom of Great Britain and Northern Ireland image

Hi dr_binks,

If all you need to do is map the same printers for everyone, you can do this with a simple bit of VB script:

Set net = CreateObject("WScript.Network")
net.AddWindowsPrinterConnection "\\myserver\myprinter","Test printer"

You can also do things like set printers depending on what groups they're a member of, but that gets much more complicated :-)
Does that help?


Sorry - I've just noticed that you did want to do it for specific group(s).

There's a useful thread at https://www.experts-exchange.com/questions/20975263/Need-VBS-logon-script-to-map-drives-and-printers-by-user-group.html#11005358 that contains some really useful example code.



Avatar of dr_binks
dr_binks

ASKER

heh, I was actually trying to avoid vbs.. I kindda just wanted to write this all in catch script, because I know what im doing
(except for when it comes to adding network printers :P )
*batch script
ok I managed to find a solution from

http://www.windowsitpro.com/Articles/Index.cfm?ArticleID=14539&DisplayTab=Article

I just tried this out in a script and it works:

rundll32 printui.dll,PrintUIEntry /if /b "HP LaserJet 4050 Series PCL" /f %windir%\inf\ntprint.inf /r "lpt1:" /m "HP LaserJet 4050 Series PCL"

im guessing there are two "LaserJet 4050 Series PCL", because one is the driver name (not the actual file name but the display name in the windows driver list) and
the other a a share name.

cheers anyways
ASKER CERTIFIED SOLUTION
Avatar of scampgb
scampgb
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
well, I tell you what, I forgot to bookmark the link where I found this info from and it had all those switches for PRINTUI.DLL. So because you saved me half an hour of trying to find it again, I shall give you the points :)