Programme bat
Résolu
coco87
Messages postés
328
Date d'inscription
Statut
Membre
Dernière intervention
-
dg_belmontet Messages postés 320 Date d'inscription Statut Membre Dernière intervention -
dg_belmontet Messages postés 320 Date d'inscription Statut Membre Dernière intervention -
bonjour,
j'ai commencé à faire un programme mais j'ai arrêté car mon 1er programme ne s'ouvre pas.
ca ne doit pas etre bien compliqué, mais bon là je sèche.
si vous pouviez me venir en aide, merci.
amicalement.
@echo off
title lanceur de programmes
echo Quel programme voulez vous lancer ?
:debut
cls
echo.
echo 1. nero startsmart
echo 2.
echo 3.
echo 4.
echo 5.
echo 6.
set /p choix=
if %choix%== 1 nero startsmart
if %choix%== 2 goto
if %choix%== 3 goto
if %choix%== 4 goto
if %choix%== 5 goto
if %choix%== 6 goto
goto debut
:nero startsmart
cls
echo Bon jeux !
start "" "C:\Program Files\Ahead\Nero StartSmart\NeroStartSmart.exe"
ping localhost /n 4s
goto end
:end
j'ai commencé à faire un programme mais j'ai arrêté car mon 1er programme ne s'ouvre pas.
ca ne doit pas etre bien compliqué, mais bon là je sèche.
si vous pouviez me venir en aide, merci.
amicalement.
@echo off
title lanceur de programmes
echo Quel programme voulez vous lancer ?
:debut
cls
echo.
echo 1. nero startsmart
echo 2.
echo 3.
echo 4.
echo 5.
echo 6.
set /p choix=
if %choix%== 1 nero startsmart
if %choix%== 2 goto
if %choix%== 3 goto
if %choix%== 4 goto
if %choix%== 5 goto
if %choix%== 6 goto
goto debut
:nero startsmart
cls
echo Bon jeux !
start "" "C:\Program Files\Ahead\Nero StartSmart\NeroStartSmart.exe"
ping localhost /n 4s
goto end
:end
A voir également:
- Programme .bat
- Fichier bat - Guide
- Bat to exe converter - Télécharger - Édition & Programmation
- Programme demarrage windows - Guide
- Mettre en veille un programme - Guide
- Message programmé iphone - Guide
2 réponses
Bonjour,
Une faute d'étourderie... il manquait le Goto de nero startsmart. De plus, évitez de mettre des espaces après les 2 signes = dans un test de variable.
Voici une solution:
@echo off
title lanceur de programmes
:debut
Cls
echo.
echo. 1: nero startsmart
echo. 2:
echo. 3:
echo. 4:
echo. 5:
echo. 6:
echo.
set /p choix=Quel programme voulez-vous lancer ?
if %choix%==1 goto nero startsmart
if %choix%==2 goto
if %choix%==3 goto
if %choix%==4 goto
if %choix%==5 goto
if %choix%==6 goto
goto debut
:nero startsmart
cls
echo Bon jeux !
start "" "C:\Program Files\Ahead\Nero StartSmart\NeroStartSmart.exe"
ping localhost /n 4s
goto end
:end
Cordialement
Une faute d'étourderie... il manquait le Goto de nero startsmart. De plus, évitez de mettre des espaces après les 2 signes = dans un test de variable.
Voici une solution:
@echo off
title lanceur de programmes
:debut
Cls
echo.
echo. 1: nero startsmart
echo. 2:
echo. 3:
echo. 4:
echo. 5:
echo. 6:
echo.
set /p choix=Quel programme voulez-vous lancer ?
if %choix%==1 goto nero startsmart
if %choix%==2 goto
if %choix%==3 goto
if %choix%==4 goto
if %choix%==5 goto
if %choix%==6 goto
goto debut
:nero startsmart
cls
echo Bon jeux !
start "" "C:\Program Files\Ahead\Nero StartSmart\NeroStartSmart.exe"
ping localhost /n 4s
goto end
:end
Cordialement
merci pour ta réponse, mais avec mes 2 programmes différents, j'arrive toujours sur l'encyclopédie CCM.
pourquoi ?
:commentcamarche
cls
echo Bon Programme !
start "" "C:\Program Files\CommentCaMarche\index.htm"
ping localhost /n 4s
goto end
:commentcamarche
cls
echo Bon Programme !
start "" "C:\Program Files\opera\opera.exe"
https://www.commentcamarche.net/"
ping localhost /n 4s
goto end
pourquoi ?
:commentcamarche
cls
echo Bon Programme !
start "" "C:\Program Files\CommentCaMarche\index.htm"
ping localhost /n 4s
goto end
:commentcamarche
cls
echo Bon Programme !
start "" "C:\Program Files\opera\opera.exe"
https://www.commentcamarche.net/"
ping localhost /n 4s
goto end
Dans un batch, il ne doit jamais y avoir d'étiquettes identiques (ici, il y 2 fois ":commentcamarche" et quelque soit le choix on arrive toujours sur la première étiquette ":commentcamarche" donc accès à l'encyclopédie CCM. Pour l'autre programme comme Opera.exe il suffira de lui attribuer une étiquette comme par exemple :Opera et de mettre le même nom au niveau du test de la variable %choix%. (Goto :Opera).
Bonne journée
Bonne journée
un grand MERCI a toi, j'ai cherché un moment sans trouver.
et pour mettre des liens internet comme "comment ca marche", que met on après C:?
"C:\Program Files\Internet explorer\iexplore.exe" "https://forums.commentcamarche.net/forum/affich-31688252-programme-bat#p31688450"
Toute cette commande est sur une même ligne. On aura le même raisonnement si on utilise un autre navigateur comme "Google Chrome" par exemple.
Cordialement