Problème d'appelle d'apli

Résolu
Raf23du06 Messages postés 2 Statut Membre -  
Raf23du06 Messages postés 2 Statut Membre -
Bonjour,
Je suis entrain de créer une "IA" du même style que S-voice pour mobile ou Cortana mais sans la demande audio.
Quand je demande d'ouvrir Google Chrome tout va bien mais si je demande l'ouverture de word, excel ou même la météo ils ne s'ouvre pas. Je n'arrive pas à en trouver la cause. Pourriez m'aider svp. Voici mon code (il n'est pas d'un très haut niveau mais j'apprend):
@echo off
:DEBUT

:: variable de la demande
set /P nombrechoisi=Que puis je faire:

:: initialisation des differents commande
set d_google=google
set d_word=word
set d_meteo=meteo
set d_exel=exel

:: differentes demande
If %nombrechoisi% equ %d_google% GOTO GOOGLE
GOTO FIN
:GOOGLE
echo Google est ok.
start chrome.exe
GOTO DEBUT

If %nombrechoisi% equ %d_word% GOTO WORD
GOTO FIN
:WORD
echo Word est ok.
start WINWORD.EXE
GOTO DEBUT

If %nombrechoisi% equ %d_meteo% GOTO METEO
GOTO FIN
:METEO
echo Meteo est ok.
start https://meteofrance.com/
GOTO DEBUT

If %nombrechoisi% equ %d_exel% GOTO EXEL
GOTO FIN
:EXEL
echo Exel est ok.
start EXCEL.EXE
GOTO DEBUT

:FIN

.........................................................................
Merci par avance de votre aide

2 réponses

  1. barnabe0057 Messages postés 14329 Date d'inscription   Statut Contributeur Dernière intervention   4 930
     
    Bonjour,

    Essaie comme ça :

    @echo off
    Setlocal enableextensions

    :DEBUT
    set "choix="

    :: variable de la demande
    echo. & set /P "choix=Que puis-je faire : "

    :: differentes demande
    If /i "%choix%"=="google" (call :fonction "Google" "chrome.exe")

    If /i "%choix%"=="word" (call :fonction "Word" "WINWORD.EXE")

    If /i "%choix%"=="meteo" (call :fonction "Meteo" "http://www.meteofrance.com/previsions-meteo-france/metropole")

    If /i "%choix%"=="excel" (call :fonction "Excel" "EXCEL.EXE")

    goto :DEBUT

    exit /B

    rem

    :fonction

    cls
    echo %~1 est ok.
    start %~2
    goto :eof

    rem

    0
  2. Raf23du06 Messages postés 2 Statut Membre
     
    Bonjour,
    merci beaucoup et oui ça fonctionne...
    encore merci
    0