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
Solved

VBScript for deploying printer is not working for Windows Vista machines

Posted on 2007-03-26
4
862 Views
Last Modified: 2008-02-01
VBscript for deploying shared printer is not working for Windows Vista.

It was perfectly working for current machines which are running in Windows XP Professional and Windows 2000 Professional.

I use two newly purchased machines come with pre-loaded Windows Vista Business. Two machines are successfully joined domain. However, it was no printer deployed through GPO.

Any idea?
0
Comment
Question by:chekfu
  • 2
4 Comments
 
LVL 6

Expert Comment

by:gvlob
ID: 18794018
Can you show us your script?
0
 
LVL 1

Author Comment

by:chekfu
ID: 18798302
Here you go:

Option Explicit
Dim objNetwork, Printer1, Printer2, Printer3, Printer4

Printer1 = "\\server01\PRN001"
Printer2 = "\\server01\PRN002"
Printer3 = "\\server01\PRN004"
Printer4 = "\\server01\PRN005"

Set objNetwork = CreateObject("WScript.Network")

objNetwork.AddWindowsPrinterConnection Printer1
objNetwork.AddWindowsPrinterConnection Printer2
objNetwork.AddWindowsPrinterConnection Printer3
objNetwork.AddWindowsPrinterConnection Printer4
WScript.Quit
0
 
LVL 2

Accepted Solution

by:
jd2066 earned 500 total points
ID: 18806608
I did a Google search for "Vista WScript.Network" and found the following page http://www.developersdex.com/asp/message.asp?p=593&r=5431945&page=2
So it would appear then this will happen if the user logging in has Administrator Privileges . The problem being that the script runs elevated and the user's desktop with printer connections runs non-elevated so the script fails to work.
If that is your problem you can use a script on that page to workaround this or remove the Administrator Privileges from the account.
Justin
0
 
LVL 1

Author Comment

by:chekfu
ID: 18807742
I see. There is total solution. This issue is also occured to mapping drives script.

Thanks for info.
0

Featured Post

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

Well hello again!  Glad to see you've made it this far without giving up.  In this, the fourth installment of my popular series, I'm going to cover functions and subroutines, what they are, and why they are useful.  Just in case you stumbled onto th…
This is pretty cool.  The purpose of this VB Script is to help you document where JAR (Java ARchive) files and specifically java class files are located so that you can address issues seen with a client or that you can speak intelligently with a dev…
The Task Scheduler is a powerful tool that is built into Windows. It allows you to schedule tasks (actions) on a recurring basis, such as hourly, daily, weekly, monthly, at log on, at startup, on idle, etc. This video Micro Tutorial is a brief intro…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

856 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