Hidden objects in SharePoint "Explorer View"
Imagine the following scenario: a user creates a folder in SharePoint Document Library and gives it a name starting with the underscore (_) character. When you then open the Document Library in Windows Explorer, the folder will not be visible if the option is not enabled in Windows Explorer:
This behavior is expected (it dates back to the days of FrontPage 2000) and is also usually the reason why the folder was named with a leading underscore.
However, if the folder is then renamed and the underscore is removed, the folder will still remain hidden in "Explorer View". This is why:
Windows Explorer communicates with SharePoint over WebDAV. For each object stored in SharePoint and browsed from Windows Explorer, the Win32FileAttributes property is sent over the wire:
Request:
PROPFIND <DocLib_URL>
[...]
Depth:1
Response:
207 MULTI-STATUS
[...]
<D:prop><D:displayname>_hidden_folder</D:displayname>[...]<D:isFolder>t</D:isFolder>[...]<Z:Win32FileAttributes>00000016</Z:Win32FileAttributes></D:prop>
[...]
The value of Win32FileAttributes (specified in the Microsoft Extensions to the WebDAV protocol) informs Windows Explorer to treat this folder as hidden. In SharePoint, this property is stored in the SPFolder object's property bag:
$folder = (Get-SPWeb https://url).Folders["DocLib_Name"].SubFolders["_Folder_with_underscore"] $folder.Properties["vti_winfileattribs"]
It is not automatically removed when the folder is renamed, but can be manually reset using:
$folder.Properties["vti_winfileattribs"]=""
Comments
Anonymous
June 07, 2013
Chris, This is my problem exactly, how do i apply the fix you mentioned?Anonymous
June 18, 2013
Hi Steve, You can use the PowerShell commands in the article to nullify the "vti_winfileattribs" property of the hidden folder: $folder = (Get-SPWeb http://<url>).Folders["<DocLib_Name>"].SubFolders["<_Folder_with_underscore>"] $folder.Properties["vti_winfileattribs"]="" CrisAnonymous
January 08, 2014
Thanks for this post. It was helpful. As a reminder (for those who may not use powershell very often), remember to issue the following command to save your work at the end. $folder.Update() In other words, the series of commands looks like this $folder = (Get-SPWeb http://<url>).Folders["<DocLib_Name>"].SubFolders["<_Folder_with_underscore>"] $folder.Properties["vti_winfileattribs"]="" $folder.Update()Anonymous
May 15, 2015
Helpful. Thanks!