Windows 10 Script to disable Network Discovery

Davidctv

New Member
Joined
Nov 2, 2015
Messages
12
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
 

Solution
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
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
 

Just try this but it won't work :( got another idea ?
Thanks
 

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
 

Just try this but it won't work
Works ok at my end
An image from 'Script to disable Network Discovery'. Command disables network discovery via firewall rules, confirmed by network settings.

An image from 'Script to disable Network Discovery'. Command disables network discovery via firewall rules, confirmed by network settings.


error message "no rule corresponding to specified criteria"
= You made a typo or didn't run as admin... could also mean your system has non-default Windows build, like a beta test copy but I assume wx pro or home.
 

Last edited by a moderator:
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 ?
 

ok, & please post a screenshot of the cmd command/ error message you get, like mine above... that would help.
 

I'll also try on my personal computer windows 10 home and got same issue maybe it's because i've got french version
 

Attachments

  • capture.webp
    capture.webp
    10.7 KB · Views: 485
This is firewall
 

Attachments

  • capture2.webp
    capture2.webp
    78.2 KB · Views: 492
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
 

netsh advfirewall firewall set rule group="Recherche du réseau" new enable=no
 

Gratz mate.
 

It works when I run cmd as admin but it won't work with a .bat or .exe :(
 

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
 

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
 

Solution
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.
 

Back
Top