Boucle FOR : ") etait inattendu"
Bonjour,
J'ai un petit launcher qui parcours une liste de hostname pour lancer un batch sur chaque poste avec le nom d'hote en parametre.
Il fonctionnait tres bien mais etait un peu lent, alors j'ai apporté une petite modification à mon batch dans le but d'accelerer son deroulement.
Maintenant il plante des le debut de l'execution avec le retour ") etait inattendu"
Je ne trouve pas mon erreur, votre aide serait très appréciée. :)
AVANT :
Code:
1 2 3 4 5 6 7 8
| @echo off
echo %time% --------------- LAUNCHER started>>log.txt
for /f %%a in ('type hostnames.txt') do (
IF EXIST "\\%%a\C$\Windows\System32\config.txt" (
start starter.cmd %%a
echo %time% $$$$$$$$$$ Started psexec for %%a $$$$$$$$$$>>log.txt
)
) |
APRES :
Code:
1 2 3 4 5 6 7 8 9 10 11
| @echo off
echo %time% --------------- LAUNCHER started>>log.txt
for /f %%a in ('type hostnames.txt') do (
PING -n 1 %%a | FIND "TTL" > NUL
IF ERRORLEVEL 1 GOTO NEXT
IF EXIST "\\%%a\C$\Windows\System32\fsdbupdate.exe" (
start /b starter.cmd %%a
echo %time% $$$$$$$$$$ Started psexec for %%a $$$$$$$$$$>>log.txt
)
:NEXT
) |