ghoomp Posted May 19, 2015 Share Posted May 19, 2015 (edited) Dear all,Can someone please help me out with this script? I can't make it work. I am not so familiar with the vb script Thanks for your help!!!!expandcollapse popupOption Explicit 'all variables must be defined Dim oReg, oShell, oFSO Dim UninstallString, ProductCode Dim strComputer, colItems, objWMIService, objItem Dim strKeyPath, subkey, arrSubKeys strComputer = "." '******************************** 'Enter Product Code Of The Application Here That You Want To Uninstall within the Bracket ProductCode = "{88C972E7-D7FC-40F3-9FE5-180957F37B45}" '******************************** ' Get scripting objects needed throughout script. Set oShell = CreateObject("WScript.Shell") '************************** UninstallString = "MsiExec.exe /X{88C972E7-D7FC-40F3-9FE5-180957F37B45} /qn" & " /norestart" Const HKEY_LOCAL_MACHINE = &H80000002 Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_ strComputer & "\root\default:StdRegProv") strKeyPath = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" oReg.EnumKey HKEY_LOCAL_MACHINE, strKeyPath, arrSubKeys For Each subkey In arrSubKeys IF subkey = ProductCode Then oShell.Run UninstallString, 1, True End If Next Set oShell = Nothing Set oReg = Nothing '************* End Code ************ Edited May 19, 2015 by ghoomp Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted May 19, 2015 Moderators Share Posted May 19, 2015 ghoomp, I am not so familiar with the vb scriptAnd as this an AutoIt forum, why would we be familiar with it either? I suggest you ask on a VB forum.M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted May 19, 2015 Moderators Share Posted May 19, 2015 For Autoit, you can do it like this:ShellExecuteWait("msiexec.exe", '/x "<uninstall code>" /qn')If you don't have the actual uninstall code (say you have several versions of an application on different machines and need to uninstall them all). You can do something like this:$sName = "PDF-XChange" $oWMI = ObjGet("winmgmts:{impersonationLevel=impersonate}!\\" & @ComputerName & "\root\cimv2") $aProducts = $oWMI.ExecQuery("Select * from Win32_Product Where Name LIKE '%" & $sName & "%'") For $app in $aProducts If StringInStr($app.Name, $sName) Then $app.Uninstall() Next "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now