troubleshooting Question

Printer Script Error

Avatar of discoveranother
discoveranother asked on
Windows 7Windows Server 2008
6 Comments1 Solution3781 ViewsLast Modified:
Have an issue where staff are logging onto windows 7 network. I have added a simple vbs printer script to their login profile, as follows:-

Set wshNetwork = CreateObject("WScript.Network")
wshNetwork.AddWindowsPrinterConnection "\\server\printer"
wshNetWork.SetDefaultPrinter "\\server\printer"

placed the script in the sysvol scripts folder also.

strangely, some staff logon and the script runs without error, others logon and it runs with the following error:-

script: \\server\netlogon\printer.vbs
line: 2
char: 1
error: the environment is incorrect
code: 8007000A
source: (null)

From what I gather they can still print. Is there anything I can add to the script to prevent the error showing ?

Staff are placed in the correct OU's and the same OU's so not sure why this is happening.
Systems Engineer

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 6 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 6 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros