UninstallDropbox.vbs
' Search computer for Dropbox installation and uninstall Dropbox if found.
' Created by Andrew Zbikowski
' Version: 2013-06-10_01
' Tested against Dropbox version 2.0.23
Option Explicit
' Objects
Dim objShell, objWMI, objFile
' Collections
Dim colFiles
' Strings
Dim strFileQuery, strComputer, strUninstallCmd
Set objShell = WScript.CreateObject("WScript.Shell")
strComputer = "."
Set objWMI = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" _
& strComputer & "\root\cimv2")
strFileQuery = "SELECT Name FROM CIM_DataFile WHERE filename = 'DropboxUninstaller' AND extension = 'exe'"
Set colFiles = objWMI.ExecQuery(strFileQuery)
if colFiles.Count > 0 Then
For Each objFile in colFiles
On Error Resume Next
strUninstallCmd = Chr(34) & objFile.Name & Chr(34) & " /S"
objShell.Run strUninstallCmd,0,True ' Run uninstaller, wait for it to finish.
Next
End If
WScript.Quit
1 comment:
Thank you for your so cool post,it is useful,i love it very much.please share with us more good articles.
QTP Training in Chennai
QTP Course in Chennai
QTP Training in Tambaram
QTP Training in OMR
LoadRunner Training in Chennai
Best Loadrunner training institute in chennai
javascript training in chennai
core java training in chennai
Post a Comment