Advertisement
pedronrivera

Remove Fire Fox Web Browser

Mar 15th, 2018
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #Remove Fire Fox Web Browser
  2.  
  3.  
  4.  
  5. #Uninstall Firefox installed user Rights
  6. $FireFoxSTDEXE = "C:\Users\%username%\AppData\Local\Mozilla Firefox\uninstall\helper.exe"
  7. $FileExistsSTD = Test-Path $FireFoxSTDEXE
  8.  
  9. If ($FileExistsSTD -eq $True) {
  10.  
  11.     get-childitem "C:\users" firefox.exe -Recurse -Force | foreach-object {
  12.         $setup = $_.directory.tostring() + "\uninstall\helper.exe"
  13.         $args = " /s"
  14.         $uninst = Start-Process $setup -PassThru -ArgumentList $args -wait
  15.         $uninst.WaitForExit()
  16.     }
  17. } Else {Write-Host "FireFox Admin Install Not Found"}
  18.  
  19. <#
  20. Delete registry key
  21. $null = New-PSDrive -Name HKU -PSProvider Registry -Root Registry::HKEY_USERS
  22. Set-Location HKU:
  23. Get-ChildItem -path HKU: | ForEach-Object {
  24. $uninstall = $_.Name + "\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*"
  25. $firefox = get-ChildItem -path $uninstall | ?{$_.Name -match "Mozilla Firefox"}
  26. write-host $firefox
  27. Remove-Item -path $firefox -Recurse -ErrorAction SilentlyContinue
  28. }
  29. #>
  30.  
  31. #Uninstall FireFox installed with Admin Rights
  32. $FireFoxADMEXE = "C:\Program Files\Mozilla Firefox\firefox.exe"
  33. $FileExistsADM = Test-Path $FireFoxADMEXE
  34. $RemoveFireFox="C:\Program Files\Mozilla Firefox\uninstall\helper.exe"
  35.  
  36. If ($FileExistsADM -eq $True) {
  37.  
  38.     #Invoke-Command $RemoveFireFox + $args
  39.     Start-Process -FilePath "$RemoveFireFox" -ArgumentList "/S"
  40.    
  41. }
  42.  
  43. Else {Write-Host "FireFox Admin Install Not Found"}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement