?
Solved

n00b needs login script for XP clients

Posted on 2004-03-30
5
Medium Priority
?
392 Views
Last Modified: 2010-04-11
Hi all,
I have completely NO experience scripting or creating .vbs files. I need a simple script that I can apply as a login script that will add a new printer to all my clients under group policy. After doing some searcing I cam across the following snippet:

Set WshNetwork = WScript.CreateObject("WScript.Network")
PrinterPath = "\\<Server>\<PrinterShareName>"
WshNetwork.AddWindowsPrinterConnection PrinterPath
WshNetwork.SetDefaultPrinter PrinterPath

Now, I have no clue how to make a script out of that, but I need something fast so I will assign the max points

Thanks!!!
0
Comment
Question by:brandonlapointe
5 Comments
 
LVL 10

Expert Comment

by:snerkel
ID: 10714960
It is actually very easy.

Lets assume PC with printer is called (eg displays in network neighbourhood as)        "DeskTop"

Printer share name is "printer1"

Open notepad and create a text file with the above

Set WshNetwork = WScript.CreateObject("WScript.Network")
PrinterPath = "\\DeskTop\printer1"
WshNetwork.AddWindowsPrinterConnection PrinterPath
WshNetwork.SetDefaultPrinter PrinterPath

Rename the file with a vbs extension

eg:-  Makeprinter.vbs

0
 

Author Comment

by:brandonlapointe
ID: 10715316
OK, I did that, and applied it to my user OU. I did a gpupdate /force and it completed successfully, but the printer did not add. I have no errors in my event log.
0
 
LVL 11

Accepted Solution

by:
infotrader earned 2000 total points
ID: 10715363
I just ran across this discussion page.  It looks like it'll do what you ask and more.
http://www.experts-exchange.com/Operating_Systems/Windows_Server_2003/Q_20936760.html

P.S.  KIX32 is great, I've been using it for 4 years now.

- Info
0
 
LVL 1

Expert Comment

by:iamgod
ID: 10723101
I suggest download microsoft utility called con2prt.exe from microsoft, place it in the netlogon directory. Use the following example to add printers based on computer name (LABXP is first five characters of computer name). the second example is to add printer to all computers

if %computername:~0,5%==LABXP \\server1\netlogon\con2prt.exe /c "\\server1\hp2200dn"

\\server1\netlogon\con2prt.exe /c "\\server1\hp2200dn"
0
 

Author Comment

by:brandonlapointe
ID: 10724245
Thanks, KIX32 was the only thing I could get to work. Good utility to have.
0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This program is used to assist in finding and resolving common problems with wireless connections.
Unable to change the program that handles the scan event from a network attached Canon/Brother printer/scanner. This means you'll always have to choose which program handles this action, e.g. ControlCenter4 (in the case of a Brother).
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question