|
uemuem
初级用户
积分 153
发帖 68
注册 2006-10-12 来自 上海
状态 离线
|
『楼 主』:
[原创]让“堪称压缩比世界第一的UHARC”自动化!
试下UHARC,支持右键发送到,自动识别文件数量、类型及是否文件夹、是否根目录,压缩文件名生成规则同WINRAR,直接生成自解压文件,压缩比堪称世界第一!
下面是我写的代码,供交流,有问题请大家完善。
@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%
|
个人主页-找餐厅:http://www.canting.cc |
|
2008-4-5 19:47 |
|
|
knoppix7
银牌会员
积分 1287
发帖 634
注册 2007-5-2 来自 cmd.exe
状态 离线
|
『第
2 楼』:
这个不是UHARC把.
原版uharc根本没有-sfx开关...
UHARC 0.6a ----- high compression multimedia archiver ----- BETA version
Copyright (c) 1997-2005 by Uwe Herklotz All rights reserved 06 Feb 2005
**** Freeware for non-commercial use **** contact: uwe.herklotz@gmx.de ****
Usage: UHARC command [-switches..] archive[.uha] [files..@listfile..!exclude..]
---< Commands >----------------------------------------------------------------
a create archive and Add files e Extract files to current directory
m create archive and Move files x eXtract files with full pathname
l List files in archive t Test files in archive
---< Switches >----------------------------------------------------------------
d<0..2> Set display mode (0 = quiet, 1 = default, 2 = verbose)
m<0..3,x,z> Set cmp.mode (0 = STORE, 1..3 = ALZ:fast..best, x = PPM, z = LZP)
md<n> Set dictionary size in KByte (must be power of 2 : 1 .. 32768)
mm[-,+] Disable/enable built-in multimedia detection/compression
o[-,+,p] Overwrite existing files (- = never, + = always, p = prompt)
p<-,r,f,e> Store (- = no, r = relative, f = full, e = excluded) pathnames
ph[-,+] Archive header encryption | ac[-,+] Clear file archive attr
pw[passwd] Set password | ae<attr> Set attr exclusion mask
r[-,+] Recurse subdirectories | b<n> Set max filebuffer size
t<dir> Set extract target dir | bpb[-,+] bpb instead of % ratio
vm[-,+] Set virtual memory usage | ed[-,+] Store empty directories
y[-,+] Assume yes on all queries | lg<file> Log output to <file>
-------------------------------------------------------------------------------
不知道你用的什么版本.
|
|
2008-4-5 20:22 |
|
|
uemuem
初级用户
积分 153
发帖 68
注册 2006-10-12 来自 上海
状态 离线
|
『第
3 楼』:
有的,我用的是uharc06a UHARCSFX.EXE 原版说明里就有啊:
-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"
|
个人主页-找餐厅:http://www.canting.cc |
|
2008-4-6 23:56 |
|
|
knoppix7
银牌会员
积分 1287
发帖 634
注册 2007-5-2 来自 cmd.exe
状态 离线
|
『第
4 楼』:
C:\Documents and Settings\lenovo>"I:\UHARC GUI v3.06 Beta-3\System\UHARC_06.exe"
a -sfx -mx "asdasdasd.uha" I:\autoit3\*.*
UHARC 0.6a ----- high compression multimedia archiver ----- BETA version
Copyright (c) 1997-2005 by Uwe Herklotz All rights reserved 06 Feb 2005
**** Freeware for non-commercial use **** contact: uwe.herklotz@gmx.de ****
ERROR: Can't create archive file
Process aborted.
..................
|
|
2008-4-7 19:10 |
|
|
uemuem
初级用户
积分 153
发帖 68
注册 2006-10-12 来自 上海
状态 离线
|
|
2008-4-7 20:35 |
|
|
knoppix7
银牌会员
积分 1287
发帖 634
注册 2007-5-2 来自 cmd.exe
状态 离线
|
『第
6 楼』:
.....................
目前用NSIS+UNARC..
|
|
2008-4-8 19:03 |
|