Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Uninstall Firefox installed user Rights
- #Variables
- $FireFoxSTDEXE = "$env:userprofile\AppData\Local\Mozilla Firefox\firefox.exe"
- $FileExistsSTD = Test-Path $FireFoxSTDEXE
- $RemoveFireFoxSTD = "$env:userprofile\appdata\Local\Mozilla\uninstall\helper.exe
- If ($FileExistsSTD -eq $True) {
- #This part of the script will go through all user folders and remove FireFox if found"
- Write-Host "FireFox User Install Found, removig FireFox now." -ForegroundColor Red
- Start-Process -FilePath "$RemoveFireFoxSTD" -ArgumentList "/S"
- #Delete FireFox Desktop Icon
- $FireFoxIcon = "$env:userprofile\Desktop\Firefox.lnk"
- $FireFoxIconExists = Test-Path $FireFoxIcon
- If ($FireFoxIconExists -eq $True) {
- Remove-Item $FireFoxIcon
- } Else {Write-Host "FireFox Not Found - User Install" -ForegroundColor Green }
- #Uninstall FireFox 64 Bit installed with Admin Rights
- #Variables
- $FireFoxADMEXE = "C:\Program Files\Mozilla Firefox\firefox.exe"
- $FileExistsADM = Test-Path $FireFoxADMEXE
- $RemoveFireFox="C:\Program Files\Mozilla Firefox\uninstall\helper.exe"
- If ($FileExistsADM -eq $True) {
- Write-Host "FireFox 64bit Admin Install Found, , removig FireFox now" -ForegroundColor Red
- Start-Process -FilePath "$RemoveFireFox" -ArgumentList "/S"
- } Else {Write-Host "FireFox Not Found - Admin Install x64" -ForegroundColor Green }
- #Uninstall FireFox 32 Bit installed with Admin Rights
- #Variables
- $32BitFireFoxADMEXE = "C:\Program Files (x86)\Mozilla Firefox\firefox.exe"
- $32BitFileExistsADM = Test-Path $32BitFireFoxADMEXE
- $32BitRemoveFireFox="C:\Program Files (x86)\Mozilla Firefox\uninstall\helper.exe"
- If ($32BitFileExistsADM -eq $True) {
- Write-Host "FireFox Admin x86 Install Found, , removig FireFox now" -ForegroundColor Red
- Start-Process -FilePath "$32BitRemoveFireFox" -ArgumentList "/S"
- } Else {Write-Host "FireFox Not Found - Admin Install x86" -ForegroundColor Green }
- <#
- Delete registry key
- $null = New-PSDrive -Name HKU -PSProvider Registry -Root Registry::HKEY_USERS
- Set-Location HKU:
- Get-ChildItem -path HKU: | ForEach-Object {
- $uninstall = $_.Name + "\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*"
- $firefox = get-ChildItem -path $uninstall | ?{$_.Name -match "Mozilla Firefox"}
- write-host $firefox
- Remove-Item -path $firefox -Recurse -ErrorAction SilentlyContinue
- }
- #>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement