Batch pour hostednetwork

Résolu
PiR/D Messages postés 213 Date d'inscription   Statut Membre Dernière intervention   -  
PiR/D Messages postés 213 Date d'inscription   Statut Membre Dernière intervention   -
Bonjour,
Je souhaite faire une commande qui quand je clique dessus démarre le hostednetwork si il est éteint et le stopper si il est allumé.
J'ai trouvé le code suivant mais il ne fait que l'allumer je ne comprends pas pourquoi.
@echo off
netsh wlan show hostednetwork|find "Statut"|find "started">nul && goto stop|| goto start

:start
    netsh wlan start hostednetwork
pause
    goto end

:stop
    netsh wlan stop hostednetwork
pause    
goto end

Comment faire ?
Cordialement

--
-insérez une citation bidon trouvée sur internet-

1 réponse

  1. dubcek Messages postés 18627 Date d'inscription   Statut Contributeur Dernière intervention   5 660
     
    hello
    que retourne la commande, quand il est démarré et quand il ne l'est pas
    netsh wlan show hostednetwork
    0
    1. PiR/D Messages postés 213 Date d'inscription   Statut Membre Dernière intervention   71
       
      Non démarré et Démarré
      0
    2. dubcek Messages postés 18627 Date d'inscription   Statut Contributeur Dernière intervention   5 660
       
      essayer
      netsh wlan show hostednetwork|find "Non">nul && goto start||goto stop
      0
    3. PiR/D Messages postés 213 Date d'inscription   Statut Membre Dernière intervention   71
       
      ça marche super merci beaucoup :D
      0