/build/static/layout/Breadcrumb_cap_w.png

HELP with vbs and KACE

when I run this script p2.vbs (located on c: - I just double click it) the printer changes default just fine....so I know the script works......however when I do it with KACE- nothing happens!

dependencies:

p2.vbs

Verify

1.Launch a program...

Directory:$(KACE_SYS_DIR)

File:cscript.exe

Parameters:$(KACE_DEPENDENCY_DIR)\p2.vbs

 

heres the script.....

strComputer = "."

Set objWMIService = GetObject("winmgmts:" _

    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

Set colInstalledPrinters =  objWMIService.ExecQuery _

    ("Select * from Win32_Printer Where PortName = 'IP_10.100.2.3' or 

 

PortName = '10.100.2.3'")

For Each objPrinter in colInstalledPrinters

    objPrinter.SetDefaultPrinter()

Next

 

This is killing me?? Anybody know what I'm doing wrong????

 


0 Comments   [ + ] Show comments

Answers (1)

Answer Summary:
Posted by: dugullett 12 years ago
Red Belt
3

Are you leaving it as default "LOCAL SYSTEM"? Try changing it to "run as user logged in to the console".


Comments:
  • That would be my guess too. You can try running it as LocalSystem through PSexec to test as well: http://www.kace.com/support/resources/kb/article/How-to-mimic-running-a-script-as-Local-System-User-Scripting?action=artikel&cat=5&id=731&artlang=en - jknox 12 years ago

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

View more:

Share

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ