JSI Tip 8174. How can I automate getting 'Add/Remove Windows Components' to display 'optional' components?


In 2274ยป How do I get Add/Remove Programs to display 'optional' components, I explained how to edit the %SystemRoot%\INF\sysoc.inf file if the operating system is already installed.

I have scripted ShowAllOptionalComponents.bat to unhide all the optional components.

The syntax for using ShowAllOptionalComponents.bat is:

ShowAllOptionalComponents

ShowAllOptionalComponents.bat contains:

@echo off
setlocal
copy %SystemRoot%\INF\sysoc.inf "%TEMP%\sysoc.inf"
del /q %SystemRoot%\INF\sysoc.inf
for /f "Tokens=*" %%a in ('type "%TEMP%\sysoc.inf"') DO (
 set line=%%a
 call :unhide
)
endlocal
goto :EOF
:unhide
set line=%line:,hide,=,,%
@echo %line%>>%SystemRoot%\INF\sysoc.inf



Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish