26 lines
1.1 KiB
PowerShell
26 lines
1.1 KiB
PowerShell
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" )
|
|
{
|
|
Write-Output "Stopping AdAppMgrSvc service"
|
|
Try { $SVC | Stop-Service -Force }
|
|
Catch { Write-Output $_.Exception.Message }
|
|
}
|
|
|
|
Write-Output "Stopping processes"
|
|
Try
|
|
{
|
|
Get-Process | Where { $_.Name -like "AdAppMgr" } | Stop-Process -Force
|
|
Get-Process | Where { $_.Name -like "AutodeskDesktopApp" } | Stop-Process -Force
|
|
}
|
|
Catch { Write-Output $_.Exception.Message }
|
|
|
|
Write-Output "Uninstalling Autodesk Desktop App"
|
|
Try { Start-Process -FilePath $PATH -ArgumentList '--mode unattended' -Wait }
|
|
Catch { Write-Output $_.Exception.Message }
|
|
}
|
|
Else { Write-Output "Autodesk Desktop App is not installed" } |