Faire afficher code errorlevel pour xcopy

Fab -  
jipicy Messages postés 41342 Statut Modérateur -
Bonjour,

J'ai un problème avec le Batch suivant ?
Aussi, j'aurais souhaité faire afficher à l'ecran le code errorlevel généré par xcopy pour comprendre d'ou cela provient

Ci-dessous le Script :

@ECHO OFF
echo Les fichiers sont en train d'etre copies
xcopy "c:\mes documents" X:\ /E /d /y /c

if ERRORLEVEL 5 goto Disque
if ERRORLEVEL 4 goto probleme
if ERRORLEVEL 2 goto Interruption
if ERRORLEVEL 1 goto aucun
if ERRORLEVEL 0 goto fin

:aucun
echo Aucun fichier a copier
goto fin2

:Interruption
echo interruption par CONTROL+C
goto fin2

:probleme
echo Espace disque ou mémoire insuffisante ou Lecteur introuvable
goto fin2

:disque
echo Erreur d'ecriture sur le disque
goto fin2

:fin
echo Copie termine avec succes
echo Arret de l'ordinateur
rem rundll32 user.exe,exitwindows

:fin2

MERCI
A voir également:

2 réponses

nob
 
quel rapport avec linux ?
2
Manu
 
J'ai un pb similaire avec xcopy

j'ai essayer ca

set ERROR=%ERRORLEVEL%
set ERROR

qui renvoi toujours 0
0
jipicy Messages postés 41342 Statut Modérateur 4 896
 
Salut,

Voir là : http://www.commentcamarche.net/forum/affich-959588#1

;-))

Z'@+...che.
JP : Zen, my Nuggets ! ;-)
0