How to deny any file opening in a specific folder

how to deny any kind of file opening in a specific folder( like test) in windows server 8.
Either its a word, excel, autocad , text or any kind of file, should not get open in that particular folder and its subfolders. but users should able to copy and paste the file & folders in test folder.

Actually I do not want to open the file in test folder. User can see the content of the folder but he should not open any file of that particular folder. sub folders should open in test folder but file opening have to be denied.

i am trying to do this by Powershell script but some errors are generating.
1st option :- Get-COMMAND “select-object ‘D:\test*.*’-open -deny”

2nd option:- when “D:\test*.’ open then Get-COMMAND "select-object 'D:\test.* ’ -open -deny”


my requirement is to disable open option ( marked in circle ) in test folder , so any user can not open the file in test folder, but user can open sub folders inside the test folder.

Welcome to the forum. :wave:t4:

AFAIK there is no built in PowerShell cmdlet offering this kind of functionality. So this is actually not a PowerShell question. I’d recommend to ask this in a “Windows System” related forum.

If I remember right you would need to manipulate the setting for each individual file type. And I’m very sceptic if you can change this setting for individual folders.

Regardless of that - When you post code, sample data, console output or error messages please format it as code using the preformatted text button ( </> ). Simply place your cursor on an empty line, click the button and paste your code.

Thanks in advance

How to format code in <---- Click :point_up_2:t4: :wink: