Solved

n00b needs login script for XP clients

Posted on 2004-03-30
5
384 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 500 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Stuck in INIT/DROTHER 2 48
VMware ESXi vswitch - performance question 2 73
svi stops eigrp advertisement 13 31
Connection Dropouts to Database on Windows Server 2008 R2 DFS 12 16
Short answer to this question: there is no effective WiFi manager in iOS devices as seen in Windows WiFi or Macbook OSx WiFi management, but this article will try and provide some amicable solutions to better suite your needs.
In this article, I am going to show you how to simulate a multi-site Lab environment on a single Hyper-V host. I use this method successfully in my own lab to simulate three fully routed global AD Sites on a Windows 10 Hyper-V host.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
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…

792 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