Il m' a été conseillé de deplacer ma question sur ce forum. J' epère qu' ici je trouverai quelc' un pour m' aider.
La commande Sleep n' étant pas une commande dos, j' ai voulu écrire un script qui me permet de jouer ce role. Il marche presque bien mon script mais de temps en temps bloque et j ai me message d' erreur suivant:
Qui siginfie:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4 Ungültige Zahl. Nummerische Konstanten sind entweder dezimale (17), hexadezimale (0x11) oder oktale (021) Zahlen.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4 Invalid number. Numeric constant are either decimal (17), hexadecimale (0x11) oder octale (021) numbers.
Pourquoi ?
Voici le script en entier:
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
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52 @ECHO OFF REM can only from 0 to 60 Sekunden be set SET limit=%1 REM without parameter 3 Sekunden default setting IF %limit%\==\ SET limit=3 ::extracts the second part from time FOR /f "tokens=1-3 delims=:" %%i in ("%time%") do set sec=%%k FOR /f "tokens=1-2 delims=," %%i in ("%sec%") do ( set secUnit=%%i ) SET tempsdepart=%secUnit% :Recommencer FOR /f "tokens=1-3 delims=:" %%i in ("%time%") do set sec=%%k FOR /f "tokens=1-2 delims=," %%i in ("%sec%") do ( set secUnit=%%i ) SET tempsfin=%secUnit% SET /A Testdp=%tempsdepart% + %limit% :: avoids tempsfin overlap of 60er seconds IF %Testdp% GEQ 60 (SET /A tempsdepart=%Testdp% - 60 SET /A tempsfin=%tempsfin% + %limit%) SET /A tempscal=%tempsfin% - %tempsdepart% IF %tempscal% LSS %limit% GOTO Recommencer :FIN ECHO tempsdepart : %tempsdepart% ECHO tempsfin : %tempsfin% ECHO tempscal : %tempscal%
Merci de bien vouloir m' aider
[/code]
Partager