Files

43 lines
2.5 KiB
PowerShell
Raw Permalink Normal View History

2020-09-07 12:47:36 -04:00
If ( Test-Path "${Env:ProgramFiles(x86)}\Autodesk\Autodesk Desktop App\removeAdAppMgr.exe" ) { $PATH = "${Env:ProgramFiles(x86)}\Autodesk\Autodesk Desktop App\removeAdAppMgr.exe" }
ElseIf ( Test-Path "${Env:ProgramFiles}\Autodesk\Autodesk Desktop App\removeAdAppMgr.exe" ) { $PATH = "${Env:ProgramFiles}\Autodesk\Autodesk Desktop App\removeAdAppMgr.exe" }
If ( $PATH )
{
$SVC = Get-Service -Name "AdAppMgrSvc"
If ( $SVC.Status -ne "Stopped" )
{
2023-10-05 13:11:38 -04:00
Write-Output "Stopping AdAppMgrSvc service"
2020-09-07 12:47:36 -04:00
Try { $SVC | Stop-Service -Force }
2023-10-05 13:11:38 -04:00
Catch { Write-Output $_.Exception.Message }
2020-09-07 12:47:36 -04:00
}
2023-10-05 13:11:38 -04:00
Write-Output "Stopping processes"
2020-09-07 12:47:36 -04:00
Try
{
2023-10-05 13:18:40 -04:00
Get-Process | Where-Object { $_.Name -like "AdAppMgr" } | Stop-Process -Force
Get-Process | Where-Object { $_.Name -like "AutodeskDesktopApp" } | Stop-Process -Force
2020-09-07 12:47:36 -04:00
}
2023-10-05 13:11:38 -04:00
Catch { Write-Output $_.Exception.Message }
2020-09-07 12:47:36 -04:00
2023-10-05 13:11:38 -04:00
Write-Output "Uninstalling Autodesk Desktop App"
2020-09-07 12:47:36 -04:00
Try { Start-Process -FilePath $PATH -ArgumentList '--mode unattended' -Wait }
2023-10-05 13:11:38 -04:00
Catch { Write-Output $_.Exception.Message }
2021-04-05 20:56:48 -04:00
If ( Test-Path "HKLM:\SOFTWARE\Wow6432Node\Autodesk\Autodesk Application Manager" ) {
2023-10-05 13:11:38 -04:00
Write-Output "Removing: ""HKLM:\SOFTWARE\Wow6432Node\Autodesk\Autodesk Application Manager"""
2021-04-05 20:56:48 -04:00
Remove-Item "HKLM:\SOFTWARE\Wow6432Node\Autodesk\Autodesk Application Manager" -Force -ErrorAction SilentlyContinue
}
If ( Test-Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Autodesk Desktop App" ) {
2023-10-05 13:11:38 -04:00
Write-Output "Removing: ""HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Autodesk Desktop App"""
2021-04-05 20:56:48 -04:00
Remove-Item "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Autodesk Desktop App" -Force -ErrorAction SilentlyContinue
}
If ( Test-Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\AdAppMgrSvc.exe" ) {
2023-10-05 13:11:38 -04:00
Write-Output "Removing: ""HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\AdAppMgrSvc.exe"""
2021-04-05 20:56:48 -04:00
Remove-Item "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\AdAppMgrSvc.exe" -Force -ErrorAction SilentlyContinue
}
If ( Test-Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\AutodeskDesktopApp.exe" ) {
2023-10-05 13:11:38 -04:00
Write-Output "Removing: ""HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\AutodeskDesktopApp.exe"""
2021-04-05 20:56:48 -04:00
Remove-Item "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\AutodeskDesktopApp.exe" -Force -ErrorAction SilentlyContinue
}
2020-09-07 12:47:36 -04:00
}
2023-10-05 13:11:38 -04:00
Else { Write-Output "Autodesk Desktop App is not installed" }