If you’ve ever needed to expand and restore multiple files from the Windows Xp CD (and don’t want to run expand for each file by hand), the following batch file might come in handy:

@echo off
setlocal
set List=X:\path\*.ex_
for /f "delims=" %%a in ('dir /b "%List%"') do expand %%a %%~na.exe

You’ll need to change “X:\path\” into the right path (where the source files are located. You should copy the files in question from the Xp CD to a folder on the hard disk).

Then replace *.ex_ (in that same line) with the right file type (for example *.dl_ – you can only expand one filetype at a time, since “expand” expects you to manually specify the output filename).

Finally, replace the %%~na.exe with the right output extension, for example %%~na.dll.

Enjoy.

Leave a Reply