Skip navigation

JSI Tip 3730. Is there an easy way to suppress an extension from displaying in Windows 2000?


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



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