Download offline layout
vs_BuildTools.exe ^
--wait ^
--lang En-us ^
--includeRecommended ^
--layout .\vs_BuildTools ^
--add Microsoft.VisualStudio.Workload.VCTools ^
--add Microsoft.VisualStudio.Workload.MSBuildTools ^
--add Microsoft.VisualStudio.Workload.NodeBuildTools ^
--add Microsoft.VisualStudio.Workload.ManagedDesktopBuildTools
Install offline layout
vs_setup.exe ^
--wait ^
--noWeb ^
--nocache ^
--passive ^
--norestart ^
--noUpdateInstaller
Uninstall
vs_setup.exe uninstall ^
--passive ^
--norestart ^
--installPath "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools"
Remove context menu
REG DELETE "HKEY_CLASSES_ROOT\Directory\shell\AnyCode" /f
REG DELETE "HKEY_CLASSES_ROOT\Directory\Background\shell\AnyCode" /f
Source