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?

[Windows]batファイルをタスクバーに固定する方法

Last updated at Posted at 2024-12-01

概要

Windowsで作ったbatファイルをアプリみたいにタスクバーに固定する方法。
StableDiffusion ComfyUIとかをアプリみたいにタスクバーから起動したい時なんかに便利。

※Macの人は以下

ステップ1:batファイルを作成

以下のようにbatファイルを作成し、
プロジェクトルートディレクトリに保存する

run-app.bat

@echo off
cd /d "<プロジェクトルートディレクトリのパス>"
call <仮想環境有効化コマンド>
cd "<エントリポイント(app.pyなど)のあるディレクトリ>"
python <エントリポイント>

ステップ2: ショートカットを作成

次に、デスクトップから
新規作成→ショートカットを作成を選択し、
「項目の場所を入力してください」の欄に以下を入力:
スクリーンショット 2024-12-02 082847.png

C:\Windows\System32\cmd.exe /c start "" "<run-app.batの正しいパス>"

ショートカットに名前を付ける:

「次へ」をクリック。
ショートカットの名前を任意のものに設定。
「完了」をクリック。

ステップ3:ショートカットのプロパティを設定する

ショートカットを右クリックして「プロパティ」を選択。
リンクを以下のように修正する。

C:\Windows\System32\cmd.exe /c "あなたのバッチファイルへのパス"

「ショートカット」タブの「作業フォルダー」欄に、
エントリポイントのあるディレクトリを設定する。

完了!

ステップ4: 任意

タスクバーに固定しちゃうと便利。
アイコン設定するとまるでアプリ。

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?