中国DOS联盟论坛

China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
Guest | Log in | Register | Members | Search | China DOS Union
中国DOS联盟论坛
The time now is 2026-09-14 23:26
47,812 topics / 349,917 posts / today 0 new / 48,268 members
DOS开发编程 & 发展交流 (开发室) » A batch file comparable to EXT (Original)
Printable Version  2,739 / 0
Floor1 Lydong Posted 2002-11-07 00:00
元老会员 Posts 407 Credits 1,468 From 广州
This is a batch file I wrote myself. Put it in the same directory as EXTRACT.EXE, and it can achieve the same effect as EXT. It can also expand the CAB file you want to extract.
Format: EXT2


EXT2.BAT contents
===============

@echo off
if "%1"=="/?" goto help
if "%1"=="/h" goto help
if "%1"=="" goto help

goto ext
:help
echo.
echo Extract *.cab files ...
echo eg:
echo EXT2 {source path * } {destination path }
echo EXT2 {source path *\*.cab } {destination path }
echo EXT2 {source file *.cab } {destination path }
echo EXT2 {source file * } {destination path }
echo EXT2 {source file *.cab } ; ----- extract files to directory "ext"
echo EXT2 {source file * } ; ----- extract files to directory "ext"
set ext=HELP
echo EXT2

goto end
:ext
: =====================EXT====================
if "%2"=="" goto NoPath
if exist %3 goto WantExtCab
if exist %1.cab goto ExtCab
if exist %1 goto ExtFullName


:ExtCab
if exist %1 for %%I IN (%1) do extract /y /e /l %2\ %%I %3 %4 %5 %6 %7 %8 %8 %9 %10 %10 %11 %12 %13 >nul
if exist %1.cab for %%I IN (%1.cab) do extract /y /e /l %2\ %%I %3 %4 %5 %6 %7 %8 %8 %9 %10 %10 %11 %12 %13 >nul
set ext=ExtCab
goto end


:ExtFullName
if exist %1 for %%I IN (%1) do extract /y /e /l %2\ %%I %3 %4 %5 %6 %7 %8 %8 %9 %10 %10 %11 %12 %13 >nul
if exist %1.cab for %%I IN (%1.cab) do extract /y /e /l %2\ %%I %3 %4 %5 %6 %7 %8 %8 %9 %10 %10 %11 %12 %13 >nul
set ext=ExtFullName

goto end


:WantExtCab
if exist %1 for %%I IN (%1) do extract /y /e /l %2\ %%I %3 %4 %5 %6 %7 %8 %8 %9 %10 %10 %11 %12 %13 >nul
if exist %1.cab for %%I IN (%1.cab) do extract /y /e /l %2\ %%I %3 %4 %5 %6 %7 %8 %8 %9 %10 %10 %11 %12 %13 >nul
set ext=WantExtCab

goto end


:NoPath
if exist %1.cab for %%I IN (%1.cab) do extract /y /e /l ext %%I >nul
if exist %1 for %%I IN (%1) do extract /y /e /l ext %%I >nul
set ext=NoPath

goto end


:error
echo.
echo Not exist %1 files or Invalid directory ...
echo.
goto end


:end
echo.
ECHO OK! ^_^
echo extract file %3 %4 %5 %6 %7 %8 %8 %9 %10 %10 %11 %12 %13
echo.




Everyone, please debug it and give me some suggestions!
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023