| タイトル |
: 現在窓ディレクトリで分岐 |
| 投稿日 | : 2026/07/05(Sun) 22:28 |
| 投稿者 | : ぞえま
|
質問おねがいします。
現在窓ディレクトリ名で完全一致させて分岐して、実行するコマンドを変えたいです。
PPx Helpの*ifmatchの項を参考に書いてみました。
【例4】や【例5】が正解だと思うのですが、うまくいきません。
どう書くのが正しいのでしょうか?
(ppx64208, Win11 Home 26200.8737)
以下は成功しました(ただ中間一致はできればやりたくなく)。
【例1】
*ifmatch "*dir1*","%1" %: *msgbox "dir1 is ok" %: *stop
*ifmatch "*dir2*","%1" %: *msgbox "dir2 is ok" %: *stop
*msgbox "not match"
以下はいずれも失敗しました。
【例2】
*ifmatch "*dir1","%1" %: *msgbox "dir1 is ok" %: *stop
*ifmatch "*dir2","%1" %: *msgbox "dir2 is ok" %: *stop
*msgbox "not match"
【例3】
*ifmatch "*dir1\","%1" %: *msgbox "dir1 is ok" %: *stop
*ifmatch "*dir2\","%1" %: *msgbox "dir2 is ok" %: *stop
*msgbox "not match"
【例4】
*ifmatch "*\dir1","%1" %: *msgbox "dir1 is ok" %: *stop
*ifmatch "*\dir2","%1" %: *msgbox "dir2 is ok" %: *stop
*msgbox "not match"
【例5】
*ifmatch "*\parent\dir1","%1" %: *msgbox "dir1 is ok" %: *stop
*ifmatch "*\parent\dir2","%1" %: *msgbox "dir2 is ok" %: *stop
*msgbox "not match"
※
"o:s,*\dir1"などとしてもダメでした。"p:dir1"とすると「指定されたファイルが見つかりません。(2)」とエラーになりました。
- 関連一覧ツリー
(▼ をクリックするとツリー全体を一括表示します)