Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to know if it is possible to temporary deny access to windows share folders for a specific user at a specific time range?

Example: Deny access to user User1 for folder WolfyShare from 23:00 to 12:00 or Allow access to user User1 for folder WolfyShare from 12:00 to 23:00

If it is possible, can you tell me how to do this?

share|improve this question
up vote 3 down vote accepted

There is no built-in utility to do this, but you could accomplish it with a scheduled revoke of the user's permissions and then a scheduled change to put the permissions back.

In Task Scheduler, you would create a basic task of cacls filename /r WolfyShare at 23:00. This revokes all access permissions of the user.

Then to restore access, you would reverse the change with cacls filename /g WolfyShare:f at 12:00.

You would create similar tasks for the other user at the corresponding times.

To disconnet a user's session, you could use net session \\computername /delete, however this method would require the user always be using the same PC.

Read about cacls.exe on Technet. Read about how to disconnect a user using net session.

share|improve this answer
Thanks for this! I did it as you tell me (with Icacls), but in case that this user is already using a file (like video clip,...) this will not stop the use of this file... any ideas why? I also disabled cache (/cache:none) – Wolfy Mar 6 '13 at 13:29
I updated my answer – Moses Mar 7 '13 at 20:02

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.