Using techniques from tip 3613 and tip 0108, I have scripted NeverShowExt.bat.

USAGE: NeverShowExt .ext

where .ext is the extension you wish to hide, such as .txt.

NeverShowExt.bat contains:

@echo off                              setlocal                              if \{%1\}

\{\} goto syntax set ext=%1 set ext=%ext:"=% set wrk=%ext:.=% if "%wrk%" EQU "%ext%" goto syntax for /f "Tokens=2 Delims

" %%i in ('assoc %ext%') do call :reg %%i endlocal goto :EOF :syntax @echo Syntax: NeverShowExt .ext endlocal goto :EOF :reg if \{%1\}==\{\} goto syntax @echo Windows Registry Editor Version 5.00>%TEMP%\NevershowExt.reg @echo \[HKEY_CLASSES_ROOT\%1\]>>%TEMP%\NevershowExt.reg @echo "NeverShowExt"="">>%TEMP%\NevershowExt.reg regedit /s %TEMP%\NevershowExt.reg