3 Replies Latest reply on Feb 22, 2015 10:57 AM by dblansky

    Does anyone have a script to remove all Google chrome products and reset the Internet Explores back to default.


      Does anyone have a script to remove all Google chrome products and reset the Internet Explores back to default? Either by batch/cmd or PowerShell.

        • 1. Re: Does anyone have a script to remove all Google chrome products and reset the Internet Explores back to default.

          These are the 3 files I have in place.  I have the Pinned Start Menu icon remain despite the cleanup in the VBS file, but it does the job of removing chrome & setting IE to default.  When I have some time to sort through things I may do some additional testing to try to identify what needs to be changed to remove the start bar icon.



          @echo off

          taskkill /F /IM chrome.exe /T

          pushd %~dp0

          cscript chrome_rmv.vbs

          regedit.exe /s Chrome_rmv.reg




          VBS - chrome_rmv.vbs :



          '~~~~~~~~~~~~~~~vbs script~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

          'This script will look through all user profiles and delete:

          ' chrome application folder ( leaving behind the user data folder in case it is a legit install

          ' shortcut located on desktop, if exists

          ' quick launch shortcut if it exists

          'this is to perform a manual uninstall of chrome

          ' ----------------------------------------------------------


          Option Explicit


          Dim objWshShell, objFSO

          Dim strAllUsersDesktopPath, strUserProfilesMainFolder

          Dim strScriptFileDirectory, SystemDrive

          dim Chromeapp, Desktop, quicklaunch, loadregistry, regfile

          Dim objwmiservice, colprocesslist, objprocess

          dim tempdir, subfolder2, temppaths

          Set objWshShell = WScript.CreateObject("WScript.Shell")

          Set objFSO = CreateObject("Scripting.FileSystemObject")


          'On Error Resume Next


          'close chrome if it is open



          ' Sets script variables and objects.



          ' finds the files and folders and deletes them





          ' ----------------------------------------------------------

          '            FUNCTIONS & SUBROUTINES

          ' ----------------------------------------------------------


          ' ----------------------------------------------------------

          Sub closechrome


          dim target_process,strcomputer

          'target process is name of process you wish to terminate.  include extemsion (.exe).  Also enclose process in quotes

          target_process= "chrome.exe"

          strComputer = "."


          Set objWMIService = GetObject("winmgmts:" _

            & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

          ' this portion of the next line ='" & target_process & "'") is = <single quote> <double quote> & target_process & <double quote> <single quote> <double quote>

          Set colProcessList = objWMIService.ExecQuery _

            ("SELECT * FROM Win32_Process WHERE Name ='" & target_process & "'")

          For Each objProcess in colProcessList



          wscript.sleep 5000

          End Sub


          Sub SetScriptItems

          ' Attempts to set the variables and objects that might be needed by the script (not all variables may be used by the script).

          strScriptFileDirectory = objFSO.GetParentFolderName(wscript.ScriptFullName)

          SystemDrive = objWshShell.ExpandEnvironmentStrings("%SystemDrive%")


          ' Attempts to obtain the Desktop path for all users.

          strAllUsersDesktopPath = objWshShell.RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders\Common Desktop")


          ' Attempts to configure Windows XP paths.

          strUserProfilesMainFolder = Mid(strAllUsersDesktopPath,1,InStr(strAllUsersDesktopPath, "\All Users"))

          If strUserProfilesMainFolder = "" Then

                  ' Attempts to configure Windows Vista paths.

                  strUserProfilesMainFolder = Mid(strAllUsersDesktopPath,1,InStr(strAllUsersDesktopPath, "\Public"))

          End If

          End Sub


          ' ----------------------------------------------------------

          Sub findfolder

          ' Loads the individual user profile hives and configures needed USER registry settings.

          Dim UserPaths, Subfolder, strSetRegistry, strRegPath ,username


          Set UserPaths = objFSO.GetFolder(strUserProfilesMainFolder).Subfolders


          For Each Subfolder in UserPaths

                  username = Subfolder.Name

                  loadregistry = "no"


          'set paths

          chromeapp = subfolder & "\Local Settings\Application Data\Google\Chrome\application"

          desktop = subfolder & "\Desktop\Google Chrome.lnk"

          quicklaunch = subfolder & "\Application Data\Microsoft\Internet Explorer\Quick Launch\Google Chrome.lnk"


          'If the path chromeapp exists, chrome is installed to user profile, and we will remove it manually

          if  objfso.FolderExists(chromeapp) Then

                  'wscript.echo "chrome found for " & username

                  objfso.deletefolder chromeapp


                  'set this to yes so we can load the ntuser.dat and delete the reg keys

                  loadregistry = "yes"

          end if


          'check for desktop shortcut, and remove

          IF objFSO.FileExists(desktop) THEN

                  'wscript.echo "desktop shortcut exists for " & username


          end if


          'check for quick launch shortcut and remove

          IF objFSO.FileExists(quicklaunch) THEN

                  'wscript.echo "quicklaunch shortcut exists for " & username


          end if


          'if chrome was found in a profile, load the ntuser.dat for that user, and merge this reg file to remove registry keys associated with it

          if loadregistry = "yes" then

                  regfile = "remove-chrome.reg"


                  ' Loads the user profile's registry hive.

                  objWshShell.Run ("Reg.exe load HKEY_USERS\CustomizeRegistry """ & Subfolder & """\NTuser.dat"), 0, True


                  'merge the reg file that deletes the reg keys

                  objwshShell.Run "regedit.exe /s " & Chr(34) & RegFile & Chr(34), 0, True


                  'Unloads the user profile registry hive.

                  objWshShell.Run ("Reg.exe unload HKEY_USERS\CustomizeRegistry"), 0, True

          End if


          'see if chrome exists in temp dirs

          tempdir= subfolder &"\Local Settings\Temp\"


          if  objfso.FolderExists(tempdir) Then


                  Set tempPaths = objFSO.GetFolder(tempdir).Subfolders

                  For Each Subfolder2 in tempPaths


                          If InStr(1, subfolder2.Name, "chrome", 1) > 0 Then

                          objfso.deletefolder subfolder2.path

                          end if


          end if


          End Sub




          Reg - Chrome_rmv.reg :



          Windows Registry Editor Version 5.00



          ; WARNING, this file will remove Google Chrome registry entries  

          ; from your Windows Registry. Consider backing up your registry before

          ; using this file: http://support.microsoft.com/kb/322756


          ; To run this file, save it as 'remove.reg' on your desktop and double-click it.
































          • 3. Re: Does anyone have a script to remove all Google chrome products and reset the Internet Explores back to default.

            happy to help!

            I know its not the cleanest process, but it did the job for me also, so I haven't focused too much time on streamlining it.