Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 351
  • Last Modified:

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
0
dr_binks
Asked:
dr_binks
  • 4
  • 3
1 Solution
 
scampgbCommented:
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?


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

There's a useful thread at http://www.experts-exchange.com/Operating_Systems/Windows_Server_2003/Q_20975263.html#11005358 that contains some really useful example code.



0
 
dr_binksAuthor Commented:
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 )
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
dr_binksAuthor Commented:
*batch script
0
 
dr_binksAuthor Commented:
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
0
 
scampgbCommented:
*grin* you didn't say that you were using .BAT files - how quaint ;-)

Incidentally, you can find out a lot more info on PRINTUI.DLL at http://www.robvanderwoude.com/2kprintcontrol.html

You should post a message in Community_Support asking them to PAQ & refund this question.



0
 
dr_binksAuthor Commented:
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 :)
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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