2009-08-14 5 views
0

Mon fichier en cours de .bat est la suivante:peu d'aide travaillant Kinks dans un .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 

Mon objectif était d'avoir quelque chose qui a ouvert le programme que si elles ne sont pas ouverts déjà. Cela fonctionne très bien, mais le seul problème est que je dois fermer manuellement les fenêtres du bloc-notes qui s'ouvrent pour lire les fichiers journaux For ****. Est-il possible de fermer ces choses automatiquement? BTW Je cours Vista.

+0

Je ne suis pas sûr que je comprends le problème ... Vous devez fermer le bloc-notes après x secondes automatiquement? – Gishu

Répondre

1

Essayez de supprimer les espaces dans le groupe de fichiers de votre instruction FOR. Par exemple:

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

au lieu de

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