Correction d'un fichier batch

Aikaterina -  
 Shinigami -
Bonjour,
qqn pourrait m'aider pour un fichier batch ... on m'a donné ce fichier en me disant il est incorrecte, corriger et dite pourquoi ...
Sauf que j'ai jamais vu la programmation batch -_-"

@echo off
REM ...
SET EX =
FOR %%D IN(%PATH%)DO IF(%EX%)==() IF EXIST %%D\%1 SET EX=%%D\%1
%EX%
SET EX=
Configuration: Windows Vista
Firefox 2.0.0.8

1 réponse

  1. Shinigami
     
    jai le meme probleme, mon fichier etant beaucoup plus complet que celui du dessu ^^

    Mon menu saffiche correctement, mais aucune des commande ne marche !

    ..............................

    @echo off

    REM Créer par Shinigami, 2007-2008, garantie sans virus !
    REM Niveau Batch de ce fichier : 3 (/20)
    mode con cols=40 lines=28

    :menu
    cls
    title Shutdown 1.0 (©2007/2008 - By Shinigami)
    ECHO Ecrivez la lettre :
    ECHO A. Interface Graphique
    ECHO B. Eteindre Immediatement
    ECHO C. Eteindre (10 sec.)
    ECHO D. Eteindre (30 sec.)
    ECHO E. Eteindre (60 sec.)
    ECHO F. Eteindre (5 min.)
    ECHO G. Eteindre (15 min.)
    ECHO H. Eteindre (30 min.)
    ECHO I. Eteindre (1 heure)
    ECHO J. Eteindre (2 heures)
    ECHO K. Eteindre (6 heures)
    ECHO L. Eteindre (12 heures)
    ECHO M. Redemarrer Immediatement
    ECHO N. Redemarrer (10 sec.)
    ECHO O. Redemarrer (30 sec.)
    ECHO P. Redemarrer (60 sec.)
    ECHO Q. Redemarrer (5 min.)
    ECHO R. Redemarrer (15 min.)
    ECHO S. Redemarrer (30 min.)
    ECHO T. Redemarrer (1 heure)
    ECHO U. Redemarrer (2 heures)
    ECHO V. Redemarrer (6 heures)
    ECHO W. Redemarrer (12 heures)
    ECHO X. Fermer la session (10 sec.)
    ECHO Y. Stopper Extinction/Redemarrage
    ECHO Z. Quitter
    ECHO.
    set /p chx=Choix :

    if %chx%==A goto Ab
    if %chx%==B goto Bb
    if %chx%==C goto Cb
    if %chx%==D goto Db
    if %chx%==E goto Eb
    if %chx%==F goto Fb
    if %chx%==G goto Gb
    if %chx%==H goto Hb
    if %chx%==I goto Ib
    if %chx%==J goto Jb
    if %chx%==K goto Kb
    if %chx%==L goto Lb
    if %chx%==M goto Mb
    if %chx%==N goto Nb
    if %chx%==O goto Ob
    if %chx%==P goto Pb
    if %chx%==Q goto Qb
    if %chx%==R goto Rb
    if %chx%==S goto Sb
    if %chx%==T goto Tb
    if %chx%==U goto Ub
    if %chx%==V goto Vb
    if %chx%==W goto Wb
    if %chx%==X goto Xb
    if %chx%==Y goto Yb
    if %chx%==Z goto Zb
    if %chx%==* goto inc

    :Ab
    cls
    shutdown -i
    pause
    goto menu

    :Bb
    cls
    shutdown -f -s
    pause
    goto menu

    :Cb
    cls
    shutdown -s -t 10 -c A bientot !
    pause
    goto menu

    :Db
    cls
    shutdown -s -t 30 -c A bientot !
    pause
    goto menu

    :Eb
    cls
    shutdown -s -t 60 -c A bientot !
    pause
    goto menu

    :Fb
    cls
    shutdown -s -t 300 -c A bientot !
    pause
    goto menu

    :Gb
    cls
    shutdown -s -t 900 -c A bientot !
    pause
    goto menu

    :Hb
    cls
    shutdown -s -t 1800 -c A bientot !
    pause
    goto menu

    :Ib
    cls
    shutdown -s -t 3600 -c A bientot !
    pause
    goto menu

    :Jb
    cls
    shutdown -s -t 7200 -c A bientot !
    pause
    goto menu

    :Kb
    cls
    shutdown -s -t 21600 -c A bientot !
    pause
    goto menu

    :Lb
    cls
    shutdown -s -t 43200 -c A bientot !
    pause
    goto menu

    :Mb
    cls
    shutdown -f -r
    pause
    goto menu

    :Nb
    cls
    shutdown -r -t 10 -c A bientot !
    pause
    goto menu

    :Ob
    cls
    shutdown -r -t 30 -c A bientot !
    pause
    goto menu

    :Pb
    cls
    shutdown -r -t 60 -c A bientot !
    pause
    goto menu

    :Qb
    cls
    shutdown -r -t 300 -c A bientot !
    pause
    goto menu

    :Rb
    cls
    shutdown -r -t 90 -c A bientot !
    pause
    goto menu

    :Sb
    cls
    shutdown -r -t 1800 -c A bientot !
    pause
    goto menu

    :Tb
    cls
    shutdown -r -t 3600 -c A bientot !
    pause
    goto menu

    :Ub
    cls
    shutdown -r -t 7200 -c A bientot !
    pause
    goto menu

    :Vb
    cls
    shutdown -r -t 21600 -c A bientot !
    pause
    goto menu

    :Wb
    cls
    shutdown -r -t 43200 -c A bientot !
    pause
    goto menu

    :Xb
    cls
    shutdown -l -t 10
    pause
    goto menu

    :Yb
    cls
    shutdown -a
    pause
    goto menu

    :Zb
    cls
    ECHO A Bientot !
    pause
    exit

    :inc
    cls
    ECHO Commande Inconnu !
    ECHO.
    pause
    goto menu

    ...................
    0