Batch pour hostednetwork

Résolu
PiR/D Messages postés 265 Statut Membre -  
PiR/D Messages postés 265 Statut Membre -
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

1 réponse

dubcek Messages postés 19021 Statut Contributeur 5 637
 
hello
que retourne la commande, quand il est démarré et quand il ne l'est pas
netsh wlan show hostednetwork
0
PiR/D Messages postés 265 Statut Membre 71
 
Non démarré et Démarré
0
dubcek Messages postés 19021 Statut Contributeur 5 637
 
essayer
netsh wlan show hostednetwork|find "Non">nul && goto start||goto stop
0
PiR/D Messages postés 265 Statut Membre 71
 
ça marche super merci beaucoup :D
0