Bonjour à tous,
Je cherche à debuguer ce script bat dont le but est de générer un autre script bat qui lui, sera executé plus tard.

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
DEBUT SCRIPT ***********************
@echo off
echo ^@echo off > toto.txt
echo tasklist ^| findstr /I /C:"%process1%" ^> nul >> toto.txt
echo if ^%errorlevel^% == 0 echo 0 >> toto.txt
echo if ^%errorlevel^% == 1 echo 1 >> toto.txt
FIN SCRIPT ***********************

RESULTAT :
D:\tmp>more toto.txt
@echo off
tasklist | findstr /I /C:"" > nul
if == 0 echo 0
if == 1 echo 1

Alors que je cherche à obtenir

@echo off
tasklist | findstr /I /C:"" > nul
if %errorlevel% == 0 echo 0
if %errorlevel% == 1 echo 1
Merci pour votre aide.

Romain