Script doesn't work with GPO

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Hi Guru's please help

I have a vbscript intended to uninstall Autocad Lite 2002 versions on the
network using Machine based Group policy. The script works perfect if I run
it on the PC and uninstall works perfect. When I put the script into the
Machine based GP, the last line
"objSoftware.Uninstall()" does not seem to work. I can prove that by puting
echo commands and pause along the way. I turned on GPO logging on the test
PCs but does not give me any clue. Can anyone help please?

Here is the script:
----------------
strComputer = "."
Const HKEY_LOCAL_MACHINE = &H80000002
Set WSHShell=WScript.CreateObject("WScript.Shell")
Set fs=CreateObject("Scripting.FileSystemObject")
Set objReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\"&_
strComputer & "\root\default:StdRegProv")
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

Set colSoftware = objWMIService.ExecQuery _
("Select * from Win32_Product Where Name = 'AutoCAD Lite 2002'")

strKeyPath = _
"Software\Microsoft\Windows\CurrentVersion\Uninstall\{91E05F90-168E-43C0-BB48-39CD0F3F2678}"
strValueName = "DisplayName"
Return = objReg.GetExpandedStringValue(HKEY_LOCAL_MACHINE,_
strKeyPath,strValueName,strValue)
' If key does exist and display name is "AutoCAD Lite 2002" then run
uninstall command
If (Return = 0) And (strValue="AutoCAD Lite 2002") And (Err.Number = 0)
Then
For Each objSoftware in colSoftware
objSoftware.Uninstall()
Next
end if

----------------------------


.



Relevant Pages

  • Re: Microsoft Warns of New Windows Flaw (March 19, 2003 )
    ... In WINDOWS SETUP in ADD/REMOVE PROGRAMS of Control Panel ... Uninstall Outlook Express, ... Java, Javascript, ActiveX and all the other script runner toys Billy ... Install WebWasher the spammers are terrified of free from ...
    (comp.security.misc)
  • Re: Microsoft Warns of New Windows Flaw (March 19, 2003 )
    ... In WINDOWS SETUP in ADD/REMOVE PROGRAMS of Control Panel ... Uninstall Outlook Express, ... Java, Javascript, ActiveX and all the other script runner toys Billy ... Install WebWasher the spammers are terrified of free from ...
    (comp.security.firewalls)
  • Re: Retrieve installation path of a software using VBScript
    ... Your script is fine, ... I think the Windows Installer (MSI) system has got ... Planning to build on this script once it succeeds at the uninstall. ...
    (microsoft.public.scripting.vbscript)
  • why Script doesnt work with GPO
    ... I have a vbscript intended to uninstall Autocad Lite 2002 versions on the ... The script works perfect if I run ... Set colSoftware = objWMIService.ExecQuery _ ... strValueName = "DisplayName" ...
    (microsoft.public.windows.group_policy)
  • Re: Retrieve installation path of a software using VBScript
    ... Planning to build on this script once it succeeds at the uninstall. ... mean you're trying to run a script in a Windows Installer ...
    (microsoft.public.scripting.vbscript)