Solved

VBScript for deploying printer is not working for Windows Vista machines

Posted on 2007-03-26
4
864 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Hello again, all.  For those of you that have been following along, you'll know that this is my third article on this topic (though it is not Part III).  This article is sort of remedial, and probably the topic with which I should have started the s…
Not long ago I saw a question in the VB Script forum that I thought would not take much time. You can read that question (Question ID  (http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/Q_28455246.html)28455246) Here (http…
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…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

713 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