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
 
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
 
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
Screenshot (271).png

Screenshot (272).png


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.
 
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.jpg
    capture.jpg
    32.3 KB · Views: 485
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
 
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
 
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