Click here to Skip to main content
15,911,711 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Fellow developers,

I need to hide a specific network folder from the Windows File Explorer that way, that an user is presented a "Forbidden Folder" message when typing/copy/pasting the mentioned folder path to the Windows File Explorer, while at the same time my dotnet-application is able to ShellExecute/Process.Run a file residing in the very same folder. Furthermore, a search out of the Windows File Explorer from the network root folder should also skip this specified folder!

Obviously the user needs file access permissions on the mentioned folder in general - but I want to allow him to access files only from within my dotnet-application (to some files, but not all).

Has anyone of you ever solved the challenge to restrict the Windows File Explorer by a program extension? Or an idea where to start from?

Thx a lot in advance,
Cheers, Rob

What I have tried:

What I came across: might Windows Shell Extensions be a starting point?
Posted
Updated 3-Dec-18 9:00am
v2
Comments
Afzaal Ahmad Zeeshan 3-Dec-18 14:02pm    
Why are you even allowing the folder to be visible on the network if it is forbidden?
\\Coders\Rob 3-Dec-18 14:19pm    
It is not forbidden entirely - while some files are forbidden some other files should remain accessible, depending on the user and his permissions granted in my appliaction!

1 solution

If it were me, I would leave folder/file access alone, and encrypt all of the files in question (or at least the ones that not everyone can read), and then, based on who logs on, allow the decryption of the appropriate files by the app. This would mitigate the necessity to have admin rights to set permissions.
 
Share this answer
 
v2
Comments
\\Coders\Rob 3-Dec-18 17:51pm    
That's a good apporach John, actually I came across that as well, it fits most needs. But it has one big drawback: you can not ShellExecute an encrypted file, that is you can not request the OS to open it via its associated application. For example, a Wordfile.docx has to become decrypted (at another Location) before it might be opened by Word.exe! But you won't realize the point, where the user finally stops saving his changes. And has he edited at all? Or was he just reading? Where is the moment to crypt the file again and move it back to the document folder?
Perhaps this approach could be handled for some defined applications (perhaps the Office Suite), but there are a lot files/extenision of jet unknown applications which needs a more genereal solution!
But anyway, thx for your suggestion :-)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900