Advertisement
pedronrivera

Remove Fire Fox Web Browser v3

Mar 16th, 2018
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #Uninstall Firefox installed user Rights
  2. #Variables
  3. $FireFoxSTDEXE = "$env:userprofile\AppData\Local\Mozilla Firefox\firefox.exe"
  4. $FileExistsSTD = Test-Path $FireFoxSTDEXE
  5. $RemoveFireFoxSTD = "$env:userprofile\appdata\Local\Mozilla\uninstall\helper.exe
  6.  
  7.        If ($FileExistsSTD -eq $True) {
  8.    
  9.            #This part of the script will go through all user folders and remove FireFox if found"
  10.             Write-Host "FireFox User Install Found, removig FireFox now." -ForegroundColor Red
  11.             Start-Process -FilePath "$RemoveFireFoxSTD" -ArgumentList "/S"
  12.  
  13.             #Delete FireFox Desktop Icon
  14.             $FireFoxIcon = "$env:userprofile\Desktop\Firefox.lnk"
  15.             $FireFoxIconExists = Test-Path $FireFoxIcon
  16.  
  17.                 If ($FireFoxIconExists -eq $True) {
  18.        
  19.                     Remove-Item $FireFoxIcon
  20.  
  21.         } Else {Write-Host "FireFox Not Found - User Install" -ForegroundColor Green }
  22.  
  23. #Uninstall FireFox 64 Bit installed with Admin Rights
  24. #Variables
  25. $FireFoxADMEXE = "C:\Program Files\Mozilla Firefox\firefox.exe"
  26. $FileExistsADM = Test-Path $FireFoxADMEXE
  27. $RemoveFireFox="C:\Program Files\Mozilla Firefox\uninstall\helper.exe"
  28.  
  29.         If ($FileExistsADM -eq $True) {
  30.    
  31.             Write-Host "FireFox 64bit Admin Install Found, , removig FireFox now" -ForegroundColor Red
  32.             Start-Process -FilePath "$RemoveFireFox" -ArgumentList "/S"
  33.  
  34.         } Else {Write-Host "FireFox Not Found - Admin Install x64" -ForegroundColor Green }
  35.  
  36. #Uninstall FireFox 32 Bit installed with Admin Rights
  37. #Variables
  38. $32BitFireFoxADMEXE = "C:\Program Files (x86)\Mozilla Firefox\firefox.exe"
  39. $32BitFileExistsADM = Test-Path $32BitFireFoxADMEXE
  40. $32BitRemoveFireFox="C:\Program Files (x86)\Mozilla Firefox\uninstall\helper.exe"
  41.  
  42.         If ($32BitFileExistsADM -eq $True) {
  43.    
  44.             Write-Host "FireFox Admin x86 Install Found, , removig FireFox now" -ForegroundColor Red
  45.             Start-Process -FilePath "$32BitRemoveFireFox" -ArgumentList "/S"
  46.  
  47.         } Else {Write-Host "FireFox Not Found - Admin Install x86" -ForegroundColor Green }
  48.  
  49.  
  50. <#
  51. Delete registry key
  52. $null = New-PSDrive -Name HKU -PSProvider Registry -Root Registry::HKEY_USERS
  53. Set-Location HKU:
  54. Get-ChildItem -path HKU: | ForEach-Object {
  55. $uninstall = $_.Name + "\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*"
  56. $firefox = get-ChildItem -path $uninstall | ?{$_.Name -match "Mozilla Firefox"}
  57. write-host $firefox
  58. Remove-Item -path $firefox -Recurse -ErrorAction SilentlyContinue
  59. }
  60. #>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement