Forum Discussion

newtotechcom-J's avatar
newtotechcom-J
Brass Contributor
Sep 17, 2023
Solved

Unable to uninstall Visual Studio Pro 2022 via Intune

Hi,

I'm able to install Visual Studio Pro 2022 but unable to uninstall it via Intune.

 

Following are the commands that I'm using:
Install command
vs_Professional.exe --nocache --wait --noUpdateInstaller --noWeb --quiet --norestart
Uninstall command
vs_Professional.exe uninstall --installPath "C:\Program Files\Microsoft Visual Studio\2022\Professional"--quiet --norestart

 

And using the following bootstrapper:
https://aka.ms/vs/17/release/vs_professional.exe

  • 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

    • newtotechcom-J's avatar
      newtotechcom-J
      Brass Contributor

      Harm_Veenstra 

      The commands that you shared should I try that in intune?

      As the commands that I shared in the post, are working on the command prompt but no visa intuune.

      • Harm_Veenstra's avatar
        Harm_Veenstra
        MVP
        Yes, put with the installer from the URL you mentioned in a folder together with a uninstall.cmd containing both of the uninstall command lines I mentioned. Create a intunewin package from that with my install command line for installation and the uninstall.cmd for uninstall. For detection you can use a file exist for C:\Program Files (x86)\Microsoft Visual Studio\Installer\vs_installer.exe
  • 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

    • kunwaraman2130's avatar
      kunwaraman2130
      Copper Contributor

      Hello Harm_ Veenstra,

       

      I was trying to uninstall the Visual Studio Community 2022 version via your commands through Intune win32app.

      I successfully uninstalled that Visual Studio Community as well.

       

      But the problem is whenever I try to uninstall the Visual Studio 2022 community through this process another version like the professional, enterprise version also gets uninstalled. 

       

      Can anyone please provide me the specific uninstallation command for Visual Studio Community 2022 version or like 2017, 2019 community version.

       

      Your help will be highly appreciable.

       

      Thanks, 

      Kunwar Aman Singh

Resources