Windows 10 Script to disable Network Discovery

Davidctv

Member
Hi,

I would like to create a bat file that will disable Network Discovery on Windows 10.
Any help would be greatly appreciated.

Thanks,
David
 

ussnorway

Windows Forum Team
Staff member
Premium Supporter
Why?
A batch file won't work but a exe (run as admin) should work...

netsh advfirewall firewall set rule group="network discovery" new enable=no
 

Davidctv

Member
error message "no rule corresponding to specified criteria" i'm french not sure of the translation, this script will be executed directly on local computer
 

Davidctv

Member
I use a classic version of Windows 10 pro I just try on another computer with w7 and it won't wor too, I will search why, maybe because i use a french version ?
 

ussnorway

Windows Forum Team
Staff member
Premium Supporter
ok, & please post a screenshot of the cmd command/ error message you get, like mine above... that would help.
 

Davidctv

Member
It works !!!! need to write in original language but i've tried with "decouverte du réseau" and the group name is "recherche du réseau" thankk you very much
 

Davidctv

Member
If somebody can help me to create an exe file.
Cause my bat won't work and if I compile my .bat in .exe it wont work too.
Just need an exe who launch
netsh advfirewall firewall set rule group="Recherche du réseau" new enable=no

Thanks
David
 

Davidctv

Member
Ok I found ! need to replace é by , in the bat !!
When I'm in cmd I need to use
netsh advfirewall firewall set rule group="Recherche du réseau" new enable=no
but for bat file need to use
netsh advfirewall firewall set rule group="Recherche du r,seau" new enable=no
 

AceInfinity

Senior Member
Microsoft MVP
Why?
A batch file won't work but a exe (run as admin) should work...

netsh advfirewall firewall set rule group="network discovery" new enable=no
Hmm? Why would you think a batch file wouldn't work? All he needs to do is right click on the *.bat file and choose to Run as Administrator. This allows the batch script to run within an elevated command prompt which is no different than typing the command into an Administrator command prompt.
 
Top