Forum Discussion
Unable to uninstall Visual Studio Pro 2022 via Intune
- Sep 19, 2023
newtotechcom-J I Installed it using your install command. I used this as the uninstall string, which also removes the Visual Studio installer after uninstalling Visual Studio Pro 2022:
"C:\Program Files (x86)\Microsoft Visual Studio\Installer\vs_installer.exe" /uninstall --passiveIt does, however, leave the CoreEditorFonts installed. You can put the command above and this one below in one uninstall.cmd and use that as uninstall string:
MsiExec.exe /X{1851460E-0E63-4117-B5BA-25A2F045801B} /qnYour initial uninstall string didn't work because it needed a space behind the Installpath before specifying the --quiet option
 
The GUID for the CoreEditorFonts was found in the Registry. I always check these paths for that:
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Uninstall
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall
Please refer to the snapshots for your reference.
Let me know if you need anything else.
- Sep 26, 2023/norestart seems ok, it didn't restart on my machine but I didn't have any other applications running at that moment. Test it 🙂
Please mark my response with the correct uninstall commands as Best Response & Like to mark this topic as solved - newtotechcom-JSep 26, 2023Brass Contributor
Thanks a lot, it finally worked.
But it restarted my machine.
Should I use: /promptrestart or /norestart like this:
MsiExec.exe /X{1851460E-0E63-4117-B5BA-25A2F045801B} /qn /norestart - Sep 26, 2023You specify uninstall.cmd in the Intune app as the uninstall command, and you have to have a file in your package named uninstall.cmd. (Not uninstall.cmd.bat or uninstall.cmd.txt) That's why it throws the error that it can't find the file, because it's simply not there 😉
 - newtotechcom-JSep 26, 2023Brass Contributor
The name of file is uninstall.cmd in notepad++ you see the filename.extension
For example for bat files it would be uninstall.cmd.bat
And for text files it would be uninstall.cmd.txt - Sep 26, 2023You can just rename the existing uninstall.cmd.bat to uninstall.cmd
 - newtotechcom-JSep 26, 2023Brass ContributorSo I need to create a text file and rename it uninstall.cmd?
 - Sep 26, 2023
newtotechcom-J Wait! 🙂 I see the problem from within your screenshot!
It should be named uninstall.cmd, not uninstall.cmd.bat 😄 Rename the file, create a new package and try again 😉
 - Sep 26, 2023Try to uninstall using the Company Portal, make a note of the time at that moment, wait for it to fail, and check the logs that were changed in that time frame and the lines in that log. Hopefully, this will give some more information.
 - newtotechcom-JSep 26, 2023Brass Contributorwhich logs should I check and what argument/line should I check?
I can see the following logs:
IntuneManagementExtension
AgentExecutor
AppActionProcessor - Sep 26, 2023It looks okay and is the same as my settings... If Visual Studio is installed, you have C:\Program Files (x86)\Microsoft Visual Studio\Installer\vs_installer.exe on the drive. Intune would have given an alert about that if not...
If you do an uninstall, could you check the logs in C:\ProgramData\Microsoft\IntuneManagementExtension\Logs ?