Fix: Cannot Share Folder

I had an issue this week with a Windows Server 2008 machine where we could not share folders.  It’s a web server where a new application needs to access data via a share on the same server.  Now this was not an issue where people could not connect to a share.  This was an issue that when we tried to enable a share the GUI just said “Could not share folder”.  NET SHARE on command prompt just said “System Error 1 has occurred.  Incorrect Function”.

I checked all the usual suspects: Server service, client for file and printer sharing, event logs, Network & Sharing Center, you name it.  The strange things was that existing shares were sharing OK.  I got MS PSS involved and they pulled loads of logs and traces and couldn’t find anything.  Today I got the case escalated to second level support.  We ran a ProcMon trace.  The Escalation Engineer noticed that the request wasn’t getting down the stack.  His first suspect was anti virus.  We disabled it but no joy.  Next up was Windows Firewall.  What?

This is where I started to get sceptical.  What the hell would a firewall have to do with enabling a file share?  I can see it preventing access to the file share but not creating it.  It turns out that there is a rule called “File and Printer Sharing (Echo Request)” (IPv4 and IPv6 versions) and that must be enabled in order to create a file share.

The firewall on this machine had been customised and that rule was removed.  That caused the issue.  So how to fix it?  The engineer wanted to restore the defaults to the Windows Firewall.  But that meant losing everything that was configured in the current firewall rule set.  We exported the rules but there’s no way to import/merge rules.

The engineer got very creative here.  He got me to go into \HKLMSYSTEMCurrentControlSetServicesSharedAccessParametersFirewallPolicyFirewall Rules.  We exported that to a .REG file.  That’s where every firewall rule is stored.  We’d just backed them up to a REG file.  We “reset defaults” in Windows Firewall and Advanced Security.  That restored the firewall back to factory settings.  We then imported the .REG file to do a merge.  Sweet.  We tested and we were able to share folders on the server.

Thanks to Addy in MS PSS for his help in getting this sorted.

2 thoughts on “Fix: Cannot Share Folder”

  1. I had the same problem in win server2012 R2. Thank you for your post. I reset the firewall to the default settings and the problem is solved.

  2. I had the same problem in windows7. After adding new rule, the problem is solved. Thank you.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.