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 --passive
It 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} /qn
Your initial uninstall string didn't work because it needed a space behind the Installpath before specifying the --quiet option
I have one more question:
I tried this command "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vs_installer.exe" uninstall --installPath "C:\Program Files\Microsoft Visual Studio\2022\Community" on my command prompt, its working fine.
But won't work on intune.
I meant intune not able to uninstall Community version via this command.
It should work the same way if you can use the command line... Then you should be able to push that command line (In a .cmd file like in the first posts), which you run as SYSTEM... What is your uninstall script?
- kunwaraman2130Jan 08, 2024Copper ContributorThanks for your help and your kindness sir.
If i get the solution, will share with you. - Jan 08, 2024Ok, well, I have no idea then anymore... If, even though specifying the installation directory, it uninstalls both versions regardless... It isn't easy. Have you tried specifying an utterly different installation folder that isn't part of the other structure?
- kunwaraman2130Jan 08, 2024Copper ContributorAlso, this MSI detection rule is based on Software Guid.
With that Software GUID, the detection rule works fine. - kunwaraman2130Jan 08, 2024Copper ContributorYes, all the details and commands are correct.
For your information, when I tried your 2 commands with the same procedure, it's working fine but uninstall other Visual Studio-like Professional as well. - Jan 08, 2024Could you confirm that the command line below is in your uninstallcommunity.cmd file? "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vs_installer.exe" uninstall --installPath "C:\Program Files\Microsoft Visual Studio\2022\Community"
Are you sure that the detection on the MSI is correct? For example, you could try file detection and check if the folder Community still exists. Is the software removed at all or not? Is it just the detection that is failing?
And the error is - kunwaraman2130Jan 08, 2024Copper Contributor
- kunwaraman2130Jan 08, 2024Copper ContributorSir, as I already mentioned there is no problem regarding the installation of Visual studio .
Both Visual Studios have already been installed.
I am facing an issue regarding uninstallation.
If you have any command that we can uninstall Visual studio community only not pro then please share that. - Jan 08, 2024And the error you receive in Intune after failed installation
- Jan 08, 2024Uninstall should work if the file is there and the uninstall script is there with the command line. Could you post a screenshot of the contents of the installation folder that you use to create the intunewin file? (With hidden files, extensions etc enabled) And the contents of the uninstall script like it is now?
- kunwaraman2130Jan 08, 2024Copper Contributor
- kunwaraman2130Jan 08, 2024Copper ContributorHarm_Veenstra, I made all the changes.
Let's see. - Jan 08, 2024
And I asked about the cmd because the previous uninstall command was done like this at the start of this topic
- Jan 08, 2024There is a " missing in your cmd, the command will not run because of that...
- kunwaraman2130Jan 08, 2024Copper ContributorSir, I have tried the same procedure with the commands that you mentioned on the first page.
that is Msi and vs_installer command.
It's working fine.
I think , i need to do something else, there is no problem with .cmd extension thing. - Jan 08, 2024Is the uninstall script named uninstallcommunity.cmd? In the screenshot it's witgoud the cmd extension, could be because you have show extensions turned off, but please check that. And you should add " at the beginning, you only added at the end of the program files part. (Needed for escaping the spaces in program files etc.)
- kunwaraman2130Jan 08, 2024Copper ContributorYes, vs_Community is in downloads, I tried it worked.
But my main concern is that uninstallation command is working fine on the system but not via intune. - Jan 05, 2024
And in the directory you created the .intunewin package from, the vs_community.exe is in that folder beneath the subfolder Downloads?
- kunwaraman2130Jan 05, 2024Copper Contributor
Sure,
Please check the following :
Kindly check and let me know
- Jan 05, 2024
Could you show the contents of the script/package that you have in Intune?
- kunwaraman2130Jan 05, 2024Copper Contributor
I tried with .cmd extension and put that command on the uninstallation folder of intune as uninstall.cmd but no luck.