7
7

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

複数ファイルを個別にzip圧縮(パスワード付き)するバッチファイル

Last updated at Posted at 2017-09-04

1ファイル1zip(パスワード付き)でzipファイルを作成する必要があったため、バッチファイルを作りました。

前提

7-zipを使います。

使い方

↓こんなファイルたちをバッチファイルにドラッグ&ドロップ
image.png

↓こうします
image.png

makezip.bat
@ECHO OFF

SET path="C:\Program Files\7-Zip\"
SET exeFile=7z.exe

REM zip解凍パスワード(%はエスケープのため%%とする)
SET pass="XXXXXXXX"

FOR %%f IN (%*) DO (
  %path%%exeFile% a -p%pass% %%~dpf%%~nf.zip %%f
)

ECHO zip圧縮完了しました。

pause
7
7
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
7
7

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?