China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-07-01 11:47
中国DOS联盟论坛 » DOS开发编程 & 发展交流 (开发室) » A batch file comparable to EXT (Original) View 2,508 Replies 0
Original Poster Posted 2002-11-07 00:00 ·  中国 广东 广州 增城区 电信
元老会员
★★★
Credits 1,468
Posts 407
Joined 2002-10-21 00:00
23-year member
UID 34
Gender Male
From 广州
Status Offline
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!
欢迎大家观临我的个人主页:

http://dosdiy.bluepc.com.cn/
http://dosdiy.ys168.com/


EMAIL: lydong@china.com.cn lydong@yeah.net
----------------------------------------------
Forum Jump: