微剋多資訊

 找回密碼
 註冊

Sign in with google

Google帳號登入

搜索

該用戶從未簽到

升級   0%

跳轉到指定樓層
主題
發表於 2012-12-2 15:01 | 只看該作者 回帖獎勵 |倒序瀏覽 |閱讀模式
autoit 調用 rar 解壓縮、與壓縮
範例載點:http://www.fileswap.com/dl/aExD4c8E3/


[code=autoit]Dim $Path = @ScriptDir
Dim $rarPath = $Path&"\rar.exe"
Dim $unrarPath = $Path&"\unrar.exe"
Dim $rarLevel = 0;;; 壓縮等級 0~5; 0 low 、 5high
Dim $rarName = "Mydata";; RAR檔名
Dim $CompressionPath = "";;;壓縮路徑
Dim $DecompressPath = @ScriptDir&"\123";;解壓縮路徑
Dim $psw = "123test"

;;----------------------( Compression )----------------------

FileDelete ($Path&$rarName&".rar");; 刪除舊的rar檔案

$rarComments = StringFormat ( "%s a -m%d -r -hp[%s] %s\%s %s", $rarPath, $rarLevel, $psw,$Path, $rarName, $CompressionPath)

;~ RunWait (@ComSpec & " /k " & $rarComments, "", @SW_SHOW) ;; SHOW
RunWait (@ComSpec & " /c " & $rarComments, "", @SW_HIDE) ;; HIDE

MsgBox ( 0, "" ,"Compression Done!")

;;----------------------( Decompress )----------------------

$unrarComments = StringFormat ( "%s x -y -p[%s] %s\%s %s",$unrarPath, $psw, $Path, $rarName, $DecompressPath)
If Not FileExists ($DecompressPath) Then DirCreate ($DecompressPath);;; 如果解壓縮路徑不存在先建立
;~ RunWait (@ComSpec & " /k " & $unrarComments, "", @SW_SHOW) ;; SHOW
RunWait (@ComSpec & " /c " & $unrarComments, "", @SW_HIDE) ;; HIDE

MsgBox ( 0, "" ,"Decompress Done!")
[/code]

本帖子中包含更多資源

您需要 登入 才可以下載或查看,沒有帳號?註冊

x
樓主熱門主題
您需要登入後才可以回帖 登入 | 註冊

本版積分規則

小黑屋|Archiver|微剋多資訊(MicroDuo)

GMT+8, 2024-4-19 20:22

Discuz! X

© 2009-2023 Microduo

快速回覆 返回頂部 返回列表