現在の .bat ファイルは次のとおりです。
@echo off
rem iTunes
tasklist /FI "IMAGENAME eq itunes.exe" /FO CSV > "C:/ForStartingStuff/ForItunes.log"
FOR /F %%A IN (' "C:/ForStartingStuff/ForItunes.log" ') DO IF %%~zA EQU 0 GOTO end
cd "C:\Program Files (x86)\iTunes"
:end
taskkill /im notepad.exe
del "C:/ForStartingStuff/ForItunes.log
rem WC3 Banlist
tasklist /FI "IMAGENAME eq WC3Banlist.exe" /FO CSV > "C:/ForStartingStuff/ForWC3Blist.log"
FOR /F %%A IN (' "C:/ForStartingStuff/ForWC3Blist.log" ') DO IF %%~zA EQU 0 GOTO end
cd "C:\Program Files (x86)\WC3Banlist"
start WC3Banlist.exe
:end
del "C:/ForStartingStuff/ForItunes.log
rem Warcraft3
tasklist /FI "IMAGENAME eq wc3.exe" /FO CSV > "C:/ForStartingStuff/ForWarcraft.log"
FOR /F %%A IN (' "C:/ForStartingStuff/ForWarcraft.log" ') DO IF %%~zA EQU 0 GOTO end
cd "C:\Program Files (x86)\Warcraft III"
start war3.exe
:end
exit
私の目標は、まだ開いていない場合にのみ、プログラムを開くものを持つことでした。これはうまく機能しますが、1 つの問題は、For****.log ファイルを読み取るために開いているメモ帳ウィンドウを手動で閉じなければならないことです。これらを自動的に閉じる方法はありますか? ところで、私はビスタを実行しています。