PC Review


Reply
Thread Tools Rate Thread

Script doesn't work with GPO

 
 
Eric Hela
Guest
Posts: n/a
 
      10th Mar 2008
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

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


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
software installation GPO versus vbscript logon script GPO installvia WMI wiggum Microsoft Windows 2000 Group Policy 2 12th Sep 2007 10:32 AM
BUG: Script blocking strips script parameters during script authorization Jonathan K. Shay Spyware Announcements 3 2nd May 2005 06:18 PM
GPO shutdown script doesn't work Craig Microsoft Windows 2000 Group Policy 2 29th Mar 2005 05:40 AM
GPO Interent Maintenance GPO Christopher Walker Windows XP Setup 0 24th Sep 2004 11:54 PM
Empty GPO (GPO Denied) Joe Microsoft Windows 2000 Group Policy 0 5th Sep 2003 03:20 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:08 PM.