LoginSignup
3
2

More than 5 years have passed since last update.

Lhaplusによる自動解凍

Posted at

Lhaplusにより、指定したフォルダ内の.tar.gzを自動解凍するサンプルです。*

@echo off

set CURRENT_PATH=C:\テストデータ(10月度)
set OTPUT_DIR=%CURRENT_PATH%

echo -----------------------------------
rem set /p RES=選択ファイルをzip圧縮   Y/N ? 
set /p RES=解凍します。よろしいですか?...   Y/N ? 
echo -----------------------------------

pushd %CURRENT_PATH%

if /i {"%RES%"}=={"N"} (
  exit
  ) else (
  rem echo %CURRENT_PATH%\直下の「*.tar.gz」ファイルを全部解凍します。
  for %%i in (*.tar.gz) do (
    Echo %%iを解凍します。
    call :SUB %%i
    )
  )

goto END

:SUB
set INPUT_FILE=%1
REM 圧縮命令メモ: "C:\Program Files\Lhaplus\Lhaplus.exe" %MOTO% /c:gz /o:"%Dest_DIR%"

"C:\Program Files\Lhaplus\Lhaplus.exe" /o:"%OTPUT_DIR%" %INPUT_FILE%
exit /b

:END
pause
exit
3
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
2