how to enable script to run exe off of local computer

  • Thread starter Thread starter John
  • Start date Start date
J

John

Hello,

We want each workstation to run it's anti-virus scan during the
shutdown of the computer. We use AVG anti-virus. I have setup the GPO to run
a script called AVGLogoff.vbs. However when it runs we get the error access
denied. I believe it is because the script's path isn't relative to the
local workstation. Below is the script, any help would be greatly
appreciated.

John

~AVGLogogg.vbs~


Const ABOVE_NORMAL = 32768
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set objStartup = objWMIService.Get("Win32_ProcessStartup")
Set objConfig = objStartup.SpawnInstance_
objConfig.PriorityClass = ABOVE_NORMAL
Set objProcess = GetObject("winmgmts:root\cimv2:Win32_Process")
objProcess.Create "c:\progra~1\grisoft\avg6\avgscan.exe /comp c:\*.*
/clean", Null, objConfig, intProcessID
 
You might need to grant the user or domain group to the
local administrators group due to it might needing to
write some log entries, etc. during the app launch.

I tested this today in my lab using the fixblast.exe file
and it needed admin rights on the local system. Once I
did that, it ran like a charm...

Dan
 
Back
Top