1

I'm trying to enable folder sharing for all.

netsh advfirewall firewall set rule group="File and Printer Sharing" new enable=Yes

Seems to work for File and Printer but

netsh advfirewall firewall set rule group="Public folder sharing" new enable=Yes

doesn't work (>>No rules match the specified criteria)

FoxyZ
  • 11
  • 3
  • I don't see a rule named "Public folder sharing". – joeqwerty Feb 28 '19 at 18:09
  • Exactly I'm not sure what's the name of the group for it too. But you can still find such a rule in Control Panel -> Advanced Sharing settings – FoxyZ Feb 28 '19 at 18:23
  • The command 'netsh advfirewall' only manages firewall settings, it has nothing to do with actually sharing folders. – Massimo Mar 01 '19 at 15:32

1 Answers1

1

Maybe I haven’t understood your question correctly, but with

netsh advfirewall firewall set rule group="File and Printer Sharing" new enable=Yes

you configure firewall for SMB protocol(SMB is used for File/Folder sharing). So you should be able to create a share with:

net share sharename=folderpath /grant:username,permissions

If you require the Network Discovery:

netsh advfirewall firewall set rule group="Network Discovery" new enable=Yes
batistuta09
  • 8,723
  • 9
  • 21