0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

個別フォルダを一括でそれぞれzip/7z圧縮する設定備忘録

Posted at

モチベーション

  • 複数のフォルダを個別に圧縮処理したい
  • Windowsの右クリック->送るメニューからできるようにすると便利

事前準備

  • 7-zipをインストールしておく
  • 7-zipのインストール先を環境変数に登録しておく

バッチファイル

7z - 7z圧縮.bat
@echo off
setlocal

set ZIP_PATH="C:\Program Files\7-Zip\7z.exe"

for %%f in (%*) do (
  %ZIP_PATH% a -t7z %%f.7z %%f
)

@echo on
7z - zip圧縮.bat
@echo off
setlocal

set ZIP_PATH="C:\Program Files\7-Zip\7z.exe"

for %%f in (%*) do (
  %ZIP_PATH% a -tzip %%f.zip %%f
)

@echo on

送るメニュー登録

  • 上記二つのbatファイルを以下のパスへ登録する
    • C:\Users{your_user_name}\AppData\Roaming\Microsoft\Windows\SendTo
    • Win+Rコマンドから「shell:sendto」を実行するとパスを開ける
0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?