bonjour,
je suis un vrai débutant dans la programmation batch, et j'ai décidé de me faire de petits programmes sympas pour m'entrainer
je me suis lancé dans un programme de shutdown, le voici:
mais la, problème. j'entre le nombre en heure que je choisis, et la console se ferme. je pense que le programme n'atteint même pas les conditions,
Code bat : 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
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41 @echo off set /p main = h avant shutdown: IF %main% == 1 GOTO 1heure IF %main% == 2 GOTO 2heure IF %main% == 3 GOTO 3heure IF %main% == 4 GOTO 4heure IF %main% == 5 GOTO 5heure IF %main% == 6 GOTO 6heure GOTO ERREUR :1heure shutdown -s -f -t 3600 GOTO FIN :2heure shutdown -s -f -t 7200 GOTO FIN :3heure shutdown -s -f -t 10800 GOTO FIN :4heure shutdown -s -f -t 14400 GOTO FIN :5heure shutdown -s -f -t 18000 GOTO FIN :6heure shutdown -s -f -t 21600 GOTO FIN :ERREUR echo erreur pause :FIN exit
voila pourquoi je réclame votre aide ^^
Partager