2009-08-14 9 views
0

Meiner aktuellen .bat-Datei ist wie folgt:Einige helfen Knick Ausarbeiten in einer .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 

Mein Ziel etwas zu haben, war, dass das Programm nur dann geöffnet, wenn sie nicht bereits geöffnet wurden. Das funktioniert gut, aber das einzige Problem ist, dass ich die Notizfenster, die geöffnet werden, manuell schließen muss, um die Protokolldateien von For **** zu lesen. Gibt es eine Möglichkeit, diese Dinge automatisch zu schließen? BTW Ich laufe Vista.

+0

Ich bin mir nicht sicher, ob ich das Problem verstehen ... Sie müssen automatisch Notizblock nach x Sekunden schließen? – Gishu

Antwort

1

Versuchen Sie, die Leerzeichen in der Dateigruppe Ihrer FOR-Anweisung zu entfernen. Zum Beispiel:

FOR /F %%A IN ("C:/ForStartingStuff/ForWarcraft.log") DO ... 

statt

FOR /F %%A IN (' "C:/ForStartingStuff/ForWarcraft.log" ') DO