MKN Да должен открываться. Там уже более новая версия, но и старая у меня работает. [more]Копируем и вставляем в текстовый файл, сохраняем под именем, скажем DriverCompressor.CMD
Код: @echo off
cls
IF NOT ERRORLEVEL 0 IF %OS%==Windows_NT (
echo.Driver Compressor supports only Windows 2K/XP/2003
echo.
pause
exit
)
TITLE Driver Compressor Tool 08/28/05
SETLOCAL ENABLEEXTENSIONS
IF NOT EXIST "%windir%\system32\find.exe" GOTO
ependancy
IF NOT EXIST "%windir%\system32\findstr.exe" GOTO
ependancy
IF NOT EXIST "%windir%\system32\expand.exe" GOTO
ependancy
IF NOT EXIST "%windir%\system32\makecab.exe" GOTO
ependancy
GOTO :Start
ependancy
echo. Driver Compressor could not find the following files:
echo.
echo. expand.exe
echo. find.exe
echo. findstr.exe
echo. makecab.exe
echo.
echo. Please restore your Windows configuration.
echo.
pause
GOTO:EOF
:Start
echo.
echo. ++++++++++++++++++++++++++++++++++++++
echo. Driver Compressor Tool
echo.
echo. ©2005 Klaas Nekeman
echo. ____________________________________
echo. msfn.org - for your unattended needs
echo. ++++++++++++++++++++++++++++++++++++++
echo.
IF EXIST *.inf (
FOR /F "TOKENS=*" %%A IN ( 'dir /B *.inf' ) DO ((( set infname=%%A ) & (call :infsetup))
echo.
)
)
IF not defined infname (
echo. Error: No setup infs are found in current directory!
echo.
pause
GOTO :EOF
)
echo. Done.
echo.
echo. Please visit msfn.org for further information and updates:
echo.
echo. http://www.msfn.org/board/index.php?showtopic=35869
echo.
pause
GOTO :EOF
:infsetup
:: Clear variables
set catalogfile=
set infdir=
set sourcebegin=
:: Detect Class for use in dirname
echo. _______________________________
echo.
echo. Setupfile: %infname%
echo.
FOR /F "tokens=1,2 delims=:= " %%i IN ( 'findstr /B /L /I /C:"Class" %infname% ^| find /I /V "ClassGUID"' ) DO ( set classname=%%j
GOTO :exitclass
)
echo. Error: Class in %infname% not found!
echo.
pause
GOTO :EOF
:exitclass
set infdir=%classname%\%infname:~0,-4%
IF NOT EXIST == "%cd%\%infdir%\" (MD %infdir%
echo. Setupdir: \%infdir:~0,-1%
echo. _______________________________
echo.
) ELSE (
echo. Error: Directory %infdir:~0,-1% already exists!
echo.
pause
GOTO :EOF
)
:: Find MS catalog file
FOR /F "tokens=1,2 delims=:= " %%i IN ( 'findstr /B /L /I /C:"CatalogFile" %infname%' ) DO ( set catalogfile=%%j
GOTO :exitcat
)
:exitcat
:: Copy inf and catalog files
echo. File: %infname%
copy /y %infname% ".\%infdir%\" > NUL
IF defined catalogfile (
echo. File: %catalogfile%
copy /y %catalogfile% ".\%infdir%\%catalogfile%" > NUL
)
FOR /F "tokens=1 delims=:" %%i IN ( 'findstr /B /L /I /C:"[SourceDisksFiles]" /N %infname%' ) DO (set sourcebegin=%%i)
IF not defined sourcebegin GOTO :EOF
FOR /F "tokens=1 delims=:" %%i IN ( 'findstr /B /L /I /C:"[" /N %infname% ^| FIND /V ":;"' ) DO ( IF %%i GTR %sourcebegin% ( set sourceend=%%i
GOTO :exitloop)
)
:exitloop
FOR /F "tokens=1,2 delims=:= " %%i IN ( 'findstr /L /I /C:"=" /N %infname% ^| FIND /V ":;"' ) DO (IF %%i GTR %sourcebegin% (IF %%i LSS %sourceend% (set sourcefile=%%j) & (Call :FileNaming))
)
GOTO :EOF
:FileNaming
IF /I %infname%==%sourcefile% GOTO :EOF
IF defined catalogfile (
IF /I "%catalogfile%" == %sourcefile% GOTO :EOF
)
set filename=%sourcefile:~0,-1%_
Call :ReadCompression
GOTO :EOF
:ReadCompression
IF /I NOT EXIST "%filename%" GOTO :RegularCompress
FOR /F "tokens=1 delims=:" %%k IN ( 'findstr /B /L /C:"MSCF" /N %filename%' ) DO ( GOTO :CompressionTrue )
CALL :NoCompression
GOTO :EOF
:CompressionTrue
echo. File: %sourcefile%
copy /y "%filename%" ".\%infdir%" > NUL
GOTO :EOF
:NoCompression
echo. File: %sourcefile%
expand "%filename%" ".\%infdir%" > NUL
IF NOT EXIST "%cd%\%infdir%\%sourcefile%" (
makecab /D CompressionType=LZX /D CompressionMemory=21 /l "%cd%\%infdir%" "%cd%\%infdir%\%filename%" > NUL
) ELSE ( makecab /D CompressionType=LZX /D CompressionMemory=21 /l "%cd%\%infdir%" "%cd%\%infdir%\%sourcefile%" > NUL
del /f /q ".\%infdir%\%sourcefile%"
)
GOTO :EOF
:RegularCompress
IF /I NOT EXIST "%sourcefile%" (
echo. Error: %sourcefile% not found!
GOTO :EOF
)
FOR /F "tokens=1 delims=:" %%k IN ( 'findstr /B /L /C:"MSCF" /N %sourcefile%' ) DO (GOTO :CompressionRegularTrue)
GOTO :NoRegularCompress
GOTO :EOF
:CompressionRegularTrue
echo. File: %sourcefile%
copy /y "%sourcefile%" ".\%infdir%\%filename%" > NUL
GOTO :EOF
:NoRegularCompress
echo. File: %sourcefile%
copy "%sourcefile%" ".\%infdir%" >NUL
makecab /D CompressionType=LZX /D CompressionMemory=21 /l "%cd%\%infdir%" "%cd%\%infdir%\%sourcefile%" > NUL
del /f /q ".\%infdir%\%sourcefile%"
GOTO :EOF
ENDLOCAL