Why VBscript breaks in computer based GP

  • Thread starter Thread starter Eric Hela
  • Start date Start date
E

Eric Hela

Please help gurus,

The script below works well if I run it on my desktop. works out perfectly.
When I put it in the group policy, it doesn't work. I insert echo at
different locations to step through the script when the PC boots and applies
the policy. When it comes to the "For each" statement it seems jump out
without stepping through all the installed products. I can see the script
steping through echo out product code one at a time. Then for some reason it
doesn't complete and jumps out and displays "Finished Script". I could see
the product code "{91E05F90-168E-43C0-BB48-39CD0F3F2678}" exist but script
did not pick this up. Could this be anything to do with how group policy
handles the script? Attached is the script. I am running this in windows XP
SP2 under windows 2000 Domain.

script
----------------

Const RemoveProCode = "{91E05F90-168E-43C0-BB48-39CD0F3F2678}"
Const msiINSTALLSTATEABSENT = 2
Const msiInstallStateLocal = 3
Const msiInstallStateSource = 4
Const msiInstallStateDefault = 5
Const MsiRemoveSilent = 2
Set oInstaller = Wscript.CreateObject("WindowsInstaller.Installer")
Set oProducts = oInstaller.Products
WScript.Echo "starting soon"
For Each sProdCode in oProducts
WScript.Echo SProdCode
If (sProdCode = RemoveProCode) then
WScript.Echo "Found and removing now"
OInstaller.UIlevel = MsiRemoveSilent
oInstaller.ConfigureProduct sProdCode, 0, msiINSTALLSTATEABSENT
WScript.Echo "successfully removed"
Exit For
End If
Next
WScript.Echo "Finished script"
Set oProducts = Nothing
Set oInstaller = Nothing
 
Hello Eric,

The script is placed under startup script in the GPO? And with gpresult on
the client you can see that it is applied?

Better try in microsoft.public.scripting.vbscript

Best regards

Meinolf Weber
Disclaimer: This posting is provided "AS IS" with no warranties, and confers
no rights.
** Please do NOT email, only reply to Newsgroups
** HELP us help YOU!!! http://www.blakjak.demon.co.uk/mul_crss.htm
 
Back
Top