Skip to main content

To uninstall using product code - Any app


To uninstall using product code (you can uninstall multiple apps at one go) - use product cod​e.txt and make sure that product code in the text file


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

On error resume next



Dim WSHShell, objFSO, strParentFldr, strProdFile,objTemp,strLine , strRegKey, strSubKey, strUninstallString, exitcode

Set WSHShell = CreateObject("WScript.Shell")

Set objFSO =CreateObject("Scripting.FileSystemObject")

strParentFldr = objFSO.GetParentFolderName(wscript.ScriptFullName)

strProdFile = strParentFldr &"\ProductCode.txt"

Set objTemp = objFSO.OpenTextFile (strProdFile, 1, True)



strSubKey = ""



Do while Not objTemp.AtEndOfStream

                strLine = objTemp.ReadLine

                strRegKey = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\"& strLine & "\"

                strSubKey = WSHShell.RegRead (strRegkey& "DisplayName")

                if strSubKey <> "" Then

                                strUninstallString ="msiexec /x" & " " & strLine & " /qn"

                                exitcode =WSHShell.Run(strUninstallString, 1, True)

                End IF

                strSubKey = ""

Loop

Wscript.quit (exitcode)


Comments

Popular posts from this blog

DP Content checking

--DP content status: use sms SELECT     v_PackageStatusDistPointsSumm.PackageID,                       v_Package.Name, v_PackageStatusDistPointsSumm.InstallStatus, v_PackageStatusDistPointsSumm.SiteCode, v_PackageStatusDistPointsSumm.ServerNALPath,                       v_PackageStatusDistPointsSumm.SourceVersion, v_PackageStatusDistPointsSumm.State, v_PackageStatusDistPointsSumm.LastCopied,                       v_PackageStatusDistPointsSumm.SourceNALPath, v_PackageStatusDistPointsSumm.SummaryDate FROM         v_PackageStatusDistPointsSumm INNER JOIN                       v_Package ON v_PackageStatusDistPointsSumm.PackageID = v_Package.PackageID WHERE     (v_PackageStatusDistPointsSumm.ServerNALPath LIKE '%XXX%')---and InstallStatus <> 'Package Installation complete' --WHERE     (v_PackageStatusDistPointsSumm.ServerNALPath LIKE '%.stores.target.com%')and InstallStatus <> 'Package Installation complete' --and Name like '%neil%&

Pull Dp concept

When a package is distributed to a PullDP, DistMgr creates a PkgXferMgr job and added to the queue. - PkgXferMgr processes the job and creates a PullDP notification in the PullDPs WMI. - PullDP reads the notification and starts the download from a assigned Standard DP based on priority. - Once the notification is written, PkgXferMgr monitors the job for next 10 hours (max value hardcoded). Every 60 mins. - If the status is not received from the PullDP, it will mark the distribution as Failed and it creates a Status Message and DistMgr processes the message. - if a package is successfully downloaded in the PullDP, even after it exceeds the 10 hours, it will send the status to MP and it will drop a file in Distmgr.box. - DistMgr will check the existing status in the PkgStatus table. - Since the PkgXferMgr already dropped a failed status, it will ignore the status which has been sent by PullDP. - So the status will stay as failed. But content is distributed. However clients won’t work d