Discussion:
FIND ne sait pas gérer les Errorlevel ?
(trop ancien pour répondre)
Davidoo
2007-03-16 09:44:10 UTC
Permalink
Bonjour
Ma question est la suivante: FIND sait-il gérer les errorlevel ?
En effet, comme indiqué dans mon ptit script ci-dessous :
dans le fichier test.log si l'occurence "toto" existe ou n'existe pas, le
résultat est le même : "echo 0" ...

Merci pour votre aide, votre expérience sur le sujet !
PS: test et résultat identiques avec FINDSTR... :-/
----------------------------
find "toto" d:\test\test.log
if errorlevel 0 goto ERR0
if errorlevel 1 goto ERR1
if errorlevel 2 goto ERR2

:ERR0
echo 0
goto fin

:ERR1
echo 1
goto fin

:ERR2
echo 2
goto fin

:fin
echo fin

----------------------------
Gilles LAURENT
2007-03-16 11:34:35 UTC
Permalink
"Davidoo" <***@discussions.microsoft.com> a écrit dans le message
de news:946B085E-B6E7-40FB-A9F3-***@microsoft.com
| Bonjour

Bonjour,

| Ma question est la suivante: FIND sait-il gérer les errorlevel ?
| En effet, comme indiqué dans mon ptit script ci-dessous :
| dans le fichier test.log si l'occurence "toto" existe ou n'existe
| pas, le résultat est le même : "echo 0" ...
|
| Merci pour votre aide, votre expérience sur le sujet !
| PS: test et résultat identiques avec FINDSTR... :-/
| ----------------------------
| find "toto" d:\test\test.log
| if errorlevel 0 goto ERR0
| if errorlevel 1 goto ERR1
| if errorlevel 2 goto ERR2
|
|| ERR0
| echo 0
| goto fin
|
|| ERR1
| echo 1
| goto fin
|
|| ERR2
| echo 2
| goto fin
|
|| fin
| echo fin
|
| ----------------------------

La condition est vraie si le dernier programme exécuté a retourné un
code de sortie supérieur ou égal au nombre donné. Il faut donc procéder
de la manière suivante :

find "toto" d:\test\test.log
if errorlevel 2 goto ERR2
if errorlevel 1 goto ERR1
if errorlevel 0 goto ERR0
--
Gilles LAURENT
http://glsft.free.fr
tom_willpa
2010-05-05 05:54:08 UTC
Permalink
high quality Soccer jerseys NBA Jersey tracksuit and jackets, GHD
hairstraightener supplier from www.willpa.com

Are you a Retail businessman who bother by the purchase price? China
Cheapest TOP wholesale website can help you

we are specialize in replica sport goods manufacturing in china, we can
offer you all kinds of soccer jersey, NBA jersey,shoes and so on. they are
the best brand replica goods whih are look the same as the original goods.
excellent quality and steady supply for them. we have been marketed in Europe
and American for 3 year. all the goods we offer are AAA quality. our soccer
jersey are Thailand style. If any goods you buy from my company have problem,
we will refund or resend them again. Most of ourProducts have no minimum
order requirements,soyou can shop retail goods at wholesale prices. if you
can buy more than 300usd. We offer free shipping. The more you buy the more
discount for you.

National soccer jerseys: http://www.willpa.com
Club soccer jerseys: http://www.willpa.com
NBA Jerseys: http://www.willpa.com
T-shirt and shirt: http://www.willpa.com
Tracksuit: http://www.willpa.com
Hoody & Jackets: http://www.willpa.com
UGG boots: http://www.willpa.com
Hair style: http://www.willpa.com
shopping Index: http://www.willpa.com

EMS shipping. 7days arrive, paypal accept

want more information pls contact us or check our website: www.willpa.com
Continuer la lecture sur narkive:
Loading...