Forum Discussion
Bjrn1765
Sep 25, 2022Copper Contributor
Uninstall user setup Visual Studio Code
Hi community! I've just integrated Visual Studio Code user setup, due to the auto upgrade feature. The Install is fine but the Uninstall is not. Admin center status is Uninstall Failed The system ca...
- Oct 17, 2022
Rudy_Ooms_MVP I saved my script as Uninstall.ps1 and added it to my VSCodeUserSetup-x64-1.65.2.intunewin file and uploaded it. I then changed the Uninstall command to PowerShell.exe -ExecutionPolicy Bypass -WindowStyle Hidden -File Uninstall.ps1. It doesn’t work on my own machine, but on three others. So that’s fine, probably something weird with my computer.
Thank you very much Rudy for your help! 😀
Sep 26, 2022
Hi...
Do I use Intune myself :P... it depends.... https://callcloud.nl
When you are packaging the msi app as a win32app you are probably using the intunewinutill tool to do so.. it sort of a zip file with the powershell install and uninstall command or in this case script in it....
Deploying apps with Intune could just act a bit different then you would expect... and calling upon the localappdata could give you an issue...
Do I use Intune myself :P... it depends.... https://callcloud.nl
When you are packaging the msi app as a win32app you are probably using the intunewinutill tool to do so.. it sort of a zip file with the powershell install and uninstall command or in this case script in it....
Deploying apps with Intune could just act a bit different then you would expect... and calling upon the localappdata could give you an issue...
Bjrn1765
Sep 26, 2022Copper Contributor
Rudy_Ooms_MVP I tried to uninstall with your PS-script via Intune and got a new error Uninstall Failed:
0x80070001 and VS Code remains installed. If I run the script manually, as admin, it works.
- Sep 27, 2022you could also try to see what happens when you try to get-childitem in the c:\users\*\appdata\local\Programs\Microsoft VS Code\ folder to search for the uninstall.exe and if found execute it?
- Bjrn1765Oct 13, 2022Copper Contributor
Rudy_Ooms_MVP Thanks Rudy! This code will work if I run it manually as local admin. I will test it in Intune and get back.
ps Code -EA Ignore | kill -Force Start-Sleep 10 $Exist = Get-ChildItem 'C:\Users\*\AppData\Local\Programs\Microsoft VS Code\unins000.exe' $Path = $Exist.FullName $Args = '/SILENT /NORESTART /FORCECLOSEAPPLICATIONS /log="C:\ProgramData\VSCodeUninstall.log"' Start-Process $Path -Args $Args -Wait- Oct 13, 2022Nice to hear, please let us know the outcome when you have tested it in Intune