

CODE: [Copy to clipboard]@echo off
set file=%temp%\list.lst
del /q/f %file% >nul
set dp=%~dp1
set dd=%dp:~0,1%
set name=%~n1
:loop
if "%~1"=="" goto go
if "%~x1"=="" echo "%~1\*">>%file%&goto lop
echo "%~1">>%file%
:lop
shift
goto loop
:go
for /f "delims=: tokens=1" %%a in ('findstr /N ".*" %file%') do set Num=%%a
if %Num% EQU 1 goto Fil
set ddp=%dp:~,-1%
for /f "skip=1 delims=:" %%i in ('^(echo "%ddp%"^&echo.^)^|findstr /o ".*"') do set/a l=%%i-5
if %l% LEQ 3 goto Drv
for /f "delims=" %%i in ("%ddp%") do set tag=%%~nxi
uharc.exe a -sfx -mx "%dp%%tag%.com" @%file%
goto :eof
:Drv
uharc.exe a -sfx -mx "%dp%%dd%.com" @%file%
goto :eof
:Fil
uharc.exe a -sfx -mx "%dp%%name%.com" @%file%
CODE: [Copy to clipboard]-sfx[stub] Create self-extracting archive (Win32 version ONLY !).
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
With this option UHARC will create a self-extracting archive
(SFX). A self-extracting archive is a Win32 executable with
appended UHARC archive. Running a SFX archive without any
options will extract ("x" command) the archive content to
current directory. The SFX program supports "x", "e" and "t"
commands for any UHARC archive (self-extracting and normal
ones) with same command-line options as UHARC program. Other
commands are not supported.
[stub] is an optional parameter specifying the stub program
used to create the SFX archive. By default stub UHARCSFX.EXE
is used which must be located in current directory or in the
directory where UHARC.EXE is running from.
The SFX option is applicable only if new archive is created.
The following DOS command can be used in order to transform
an existing UHARC archive into SFX:
COPY /B UHARCSFX.EXE+"archive.uha" "archive.exe"
| 欢迎光临 中国DOS联盟论坛 (http://cndos.fam.cx/forum/) | Powered by Discuz! 2.5 |