?
Solved

n00b needs login script for XP clients

Posted on 2004-03-30
5
Medium Priority
?
388 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Connect further...control easier

With the ATEN CE624, you can now enjoy a high-quality visual experience powered by HDBaseT technology and the convenience of a single Cat6 cable to transmit uncompressed video with zero latency and multi-streaming for dual-view applications where remote access is required.

Question has a verified solution.

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

Make the most of your online learning experience.
This program is used to assist in finding and resolving common problems with wireless connections.
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
Suggested Courses

762 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