' uninstall_esilo.vbs ' ' Uninstalls eSilo Backup regardless of install location ' ' Execute with: "cscript.exe /B uninstall_esilo.vbs" ' Option Explicit Dim objShell, objStdOut, Command, Ok, strKeyPath Dim strKeyPaths(3) strKeyPaths(0) = "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\eSiloBackup\UninstallString" strKeyPaths(1) = "HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\eSiloBackup\UninstallString" strKeyPaths(2) = "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\eSilo Backup\UninstallString" strKeyPaths(3) = "HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\eSilo Backup\UninstallString" Set objShell = CreateObject("Wscript.shell") Set objStdOut = WScript.StdOut Ok = false On Error Resume Next ' Try to find the registry key For Each strKeyPath in strKeyPaths Command = objShell.RegRead(strKeyPath) Select Case Err Case 0: objStdOut.WriteLine "Registry key found: '" + strKeyPath + "'" Ok = true Exit For Case Else objStdOut.WriteLine "Registry key NOT found: '" + strKeyPath + "'" Err.clear End Select Next If (Ok = true) Then objStdOut.WriteLine "Using Command: '" + Command + "'" Command = Command + " /S" objStdOut.WriteLine "Modified Command: '" + Command + "'" objShell.Run Command, 1, false Select Case Err Case 0: objStdOut.WriteLine "Command executed successfully" WScript.Quit 0 Case Else objStdOut.WriteLine "Command failed" WScript.Quit 1 End Select Else objStdOut.WriteLine "Unable to determine uninstall command. Are you sure the program is installed?" WScript.Quit 2 End If