' Replace { ** ** } sections with the appropriate information 'Licensed under the Creative Commons License, Version 3.0 (the "License"); 'you may not use this file except in compliance with the License. 'You may obtain a copy of the License at ' 'http://creativecommons.org/licenses/by-sa/3.0/us/ ' 'Unless required by applicable law or agreed to in writing, software 'distributed under the License is distributed on an "AS IS" BASIS, 'WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 'See the License for the specific language governing permissions and 'limitations under the License. CONST HKEY_LOCAL_MACHINE = &H80000002 Dim wmiObj Dim baseInstallDir, folderObj, subFolders, folder, oTS, publisherid, strKeyPath, strValueName, strValue Set StdOut = WScript.StdOut ' Fetch the publisher ID from the file system for uninstall usage Set wmiObj = CreateObject("Scripting.FileSystemObject") Set oTS = wmiObj.OpenTextFile("{ ** AIR APP INSTALL PATH ** }\META-INF\AIR\publisherid") publisherid = oTS.ReadAll oTS.close set oTS = nothing Set wmiObj = nothing Set wmiObj = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\default:StdRegProv") strKeyPath = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{ ** AIR APP ID NAME ** }." & publisherid strValueName = "UninstallString" wmiObj.GetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValue If strValue = "" Then strKeyPath = "SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{ ** AIR APP ID NAME ** }." & publisherid wmiObj.GetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValue End If Set wmiObj = nothing StdOut.WriteLine strValue & " /quiet /qn" ' Run uninstaller executable derived from registry Set wmiObj = WScript.CreateObject ("WScript.Shell") wmiObj.run strValue & " /quiet /qn" Set wmiObj = nothing ' Cleanup folders with custom information such as images and configurations Set wmiObj = CreateObject("Scripting.FileSystemObject") Set subFolders = wmiObj.GetFolder("C:\Documents and Settings").SubFolders For Each folder in subFolders If wmiObj.FolderExists("C:\Documents and Settings\" & folder.name & "\Application Data{ ** AIR APP ID NAME ** }." + publisherid) Then 'StdOut.WriteLine "Delete: " & "C:\Documents and Settings\" & folder.name & "\Application Data\{ ** AIR APP ID NAME ** }." + publisherid wmiObj.DeleteFolder("C:\Documents and Settings\" & folder.name & "\Application Data\{ ** AIR APP ID NAME ** }." + publisherid) End If Next Set wmiObj = nothing