推 AsDfJJJ:推用心分享 08/16 05:55
推 newversion:如果過程中要秀出正在解壓的檔案 zxf 可改成 zxvf 08/17 22:05
→ newversion:另外解壓 .tar.bz2 .tbz zxf 改成 jxf 08/17 22:07
謝謝 加進去了
推 yinjing:推分享 08/19 20:55
-------
<補充>更簡單的方法
- 安裝Cygwin-Lite跟bzip2
http://cygwin-lite.sourceforge.net/
http://gnuwin32.sourceforge.net/packages/bzip2.htm
Cygwin-Lite + bzip2 只要3MB左右的空間
不像 CygWin 或 MSYS+MinGW 要幾十幾百MB
- 把"C:\cygwin\bin"和"C:\Program Files\GnuWin32\bin"加到PATH
- 將下面內容寫入untar_unzip.bat
@echo off
echo ================================================================
echo [Fileext] = %~x1
echo [Parent path] = %~d1%~p1
echo [Filename w/ ext] = %~n1%~x1
echo [Filename w/o ext] = %~n1
echo ================================================================
REM cd to where the zipped file located
cd "%~d1%~p1"
REM unzip the file according to its extension
if not ["%~x1"]==[".bz2"] goto endbzip2
echo "fileext is .tar.bz2"
"bzip2" -d "%~n1%~x1"
"tar" -xf "%~n1"
"rm" "%~n1"
goto end
:endbzip2
if not ["%~x1"]==[".gz"] goto endgzip
echo "fileext is .tar.gz"
"gzip" -d "%~n1%~x1"
"tar" -xf "%~n1"
"rm" "%~n1"
goto end
:endgzip
if not ["%~x1"]==[".tgz"] goto endtgz
echo "fileext is .tgz"
"gzip" -d "%~n1%~x1"
"tar" -xf "%~n1.tar"
"rm" "%~n1.tar"
goto end
:endtgz
if not ["%~x1"]==[".tbz"] goto endtbz
echo "fileext is .tbz"
"bzip2" -d "%~n1%~x1"
"tar" -xf "%~n1.tar"
"rm" "%~n1.tar"
goto end
:endtbz
if not ["%~x1"]==[".tar"] goto tar
echo "fileext is .tar"
:tar
"tar" -xf "%~n1%~x1"
"rm" "%~n1%~x1"
goto end
:end
pause
- 將untar_unzip.bat放到"C:\Documents and Settings\[id]\SendTo"
※ 編輯: Holocaust123 來自: 140.112.30.32 (11/07 12:29)