LoginSignup
3
2

More than 5 years have passed since last update.

【バッチファイル】ダブルクリックで自身を最小化して起動しなおす【備忘録】

Last updated at Posted at 2013-06-20

備忘録として。

下のように書く

@echo off
if not "%~0"=="%~dp0.\%~nx0" start /min cmd /c,"%~dp0.\%~nx0" %* & goto EOF

rem 処理はここに書く

:EOF

若しくはこう

@if not "%~0"=="%~dp0.\%~nx0" start /min cmd /c,"%~dp0.\%~nx0" %* & goto EOF

rem ここに処理を書く

:EOF

start /min cmd /c,"%~dp0.\%~nx0"の,が無いとコマンドラインから実行した時に止まる

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