Help Needed: Writing a PowerShell Script to Remove Windows Desktop Runtime 6.0.36 Silently

0
5
Asked By TechNinja42 On

I'm looking for some help with a PowerShell script to detect and silently remove Windows Desktop Runtime 6.0.36 (both x64 and x86 versions) from users' machines via Intune. I'm not very familiar with PowerShell, and the script I tried generating with AI didn't work as I hoped. Any guidance or suggestions would be greatly appreciated!

3 Answers

Answered By CodeWizard88 On

It seems like you need to share your script in text form for the community to help you out. Posting it as a script block in the comments can get you more targeted advice. Also, let us know what errors you’re facing or where you’re stuck!

Answered By PowerShellHero On

When it comes to uninstalling the software, you can use a loop to go through the detected apps and try to uninstall them. Here’s a basic remediation script you might find helpful:
```powershell
$apps = Get-WmiObject -Class Win32_Product | Where-Object {
$_.Name -eq "Microsoft Windows Desktop Runtime - 6.0.36 (x64)" -or
$_.Name -eq "Microsoft Windows Desktop Runtime - 6.0.36 (x86)"
}

foreach ($app in $apps) {
try {
$app.Uninstall() | Out-Null
Write-Host "Uninstalled $($app.Name)"
} catch {
Write-Host "Failed to uninstall $($app.Name): $_"
}
}
```
Give that a shot!

Answered By ScriptMaster99 On

You could start with a simple detection script to identify if the runtime is installed. Here's a snippet that checks for both versions of the runtime:
```powershell
$runtime64 = Get-WmiObject -Class Win32_Product | Where-Object { $_.Name -eq "Microsoft Windows Desktop Runtime - 6.0.36 (x64)" }
$runtime86 = Get-WmiObject -Class Win32_Product | Where-Object { $_.Name -eq "Microsoft Windows Desktop Runtime - 6.0.36 (x86)" }

if ($runtime64 -or $runtime86) {
Write-Host "Detected"
exit 1
} else {
Write-Host "Not Detected"
exit 0
}
```
Let me know if this helps!

DevUnicorn23 -

That’s a solid detection snippet! Just make sure to handle exceptions for when the uninstall command is run. Good luck!

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.