Using only standard commands, I have scripted UsedExtensions.bat to display the file extensions that are used on a specified drive or folder.
The syntax for using UsedExtensions.bat is:
UsedExtensions Object
Where Object can be any valid file system object, like D: or "C:\Documents and Settings" or \\ServerName\ShareName.
The output is displayed on the console, like:
"" ".dll" ".msstyles" ".ppt" ".txt" ".ZIP"or you can redirect it to a file using UsedExtensions Object>FileName.
UsedExtensions.bat contains:
@echo off if \{%1\}==\{\} @echo Syntax: UsedExtensions Object&goto :EOF setlocal set drv=%1 set fn=%TEMP%\UsedExtensions_%RANDOM% for /f "Tokens=*" %%a in ('dir %drv% /b /s /a-d /a') do ( if not exist "%fn%%%~xa" @echo.%%~xa>"%fn%%%~xa" ) for /f "Tokens=*" %%a in ('dir "%fn%*.*" /b') do ( @echo "%%~xa" del /q "%TEMP%\%%a" ) endlocal
0 comments
Hide comments