views:

143

answers:

2

What Windows API function should I use to mark/unmark files/folders as protected operating system file?

+2  A: 

You can use the SetFileAttributes() API with flags FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_SYSTEM.

cedrou
There is a registry entry called UseSystemForSystemFolders that might change the required attribute
Anders
+2  A: 

PathMakeSystemFolder() is the documented way to mark a directory as a system folder

Anders