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
Both Visual Studio had uninstalled because both(Professional and Community) versions are same.
Ah, ok... Is the Community Edition installed in another location? (Not in "C:\Program Files\Microsoft Visual Studio\2022\Professional" I presume?) Then you could change the uninstall to something like this:
vs_Community.exe uninstall --installPath "C:\Program Files\Microsoft Visual Studio\2022\Community"--quiet --norestart
(I don't know the .exe name of the Community version)
- 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 07, 2024Copper ContributorHarm_Veenstra, I made all the changes.
Let's see. - Jan 07, 2024
And I asked about the cmd because the previous uninstall command was done like this at the start of this topic
- Jan 07, 2024There is a " missing in your cmd, the command will not run because of that...
- kunwaraman2130Jan 07, 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 07, 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 07, 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.
- Jan 05, 2024
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 05, 2024Copper Contributor
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. - kunwaraman2130Jan 04, 2024Copper Contributor
I have tried of these steps via intune but no luck.
Is there any other way?
- Jan 04, 2024
This post says:
vs_setup.exe uninstall --installPath "C:\Program Files (x86)\Microsoft Visual Studio\2022\Community" --quiet --norestart
Could you try :
Visual Studio Community 2022 Silent Install (How-To Guide)
Visual Studio Community 2022 is a free, fully-featured IDE for students, open-source and individual developers. This article will serve as an informative guide and give you a clear understanding of how to perform a silent installation of Visual Studio Community 2022 from the command line using the EXE installer.
How to Install Visual Studio Community 2022 Silently
Visual Studio Community 2022 Silent Install (EXE)
- Navigate to: https://aka.ms/vs/17/release/vs_Community.exe
- Download the vs_Community.exe to a folder created at (C:\Downloads)
- Open an Elevated Command Prompt by Right-Clicking on Command Prompt and select Run as Administrator
- Navigate to the C:\Downloads folder
- Enter the following command to extract the setup files:
- vs_Community.exe --layout .\vs_Community
- Press Enter
- Navigate to the C:\Downloads\vs_Community folder
You should see vs_setup.exe there, then try:
vs_setup.exe uninstall --installPath "C:\Program Files (x86)\Microsoft Visual Studio\2022\Community" --quiet --norestart
- kunwaraman2130Jan 04, 2024Copper Contributor
This is the executable path:
C:\Program Files\Microsoft VisualStudio\2022\Community\Common7\IDE\devenv.exe.
Then i tried to put that in my command but no luck.