Sign in to follow this  
Followers 0
cheeseslice

Setting size of Mapped drive

4 posts in this topic

could anyone throw a few suggestions my way.

I have written a script that allows the user to log onto a NAS and map a drive to their computer. When they run the script it checks to see if a folder on the NAS matches their logon name, if it doesn't it creates this and then maps drive letter K: to this folder.

The problem I have is that people are now abusing this and using more space than I can afford. I have got to the stage where the script will now get the size of all of the files in their mapped folder and check it against the set limit but I don't know what would be the best way to proceed. I have been trying now for 2 days to implement a file browser which would only allow the users to delete or move the files but I'm not having much success.

Can anyone think of an easier way to do this. Basically I don't want them to be able to do anything to the folder except move or delete files from it.

Is there an attribute that can be set on a folder for delete only? maybe that's wishful thinking.

Any thoughts would be much appreciated.

Share this post


Link to post
Share on other sites



there are no options to set quotas on the NAS unfortunatley. (i wish there were)

the only way i thought of getting around this was to keep the focus on the gui that i have created and make the user either delete or move the files there and then. i was hoping i just missed some easy option.

Share this post


Link to post
Share on other sites

Do you have access to NTFS permissions on the folder? If so, you can use the cacls command-line command to change their users' permissions to allow only "Traverse folder / execute file", "List folder/read data", "delete subfolders and files", and "delete" until they've freed up space, then run it again to restore "full control". That should do the trick, because even though they could still open up read-only versions of the files, they can't save anything to the folder then...making it useless to continue until they've freed up space. In fact, they may NEED to be able to open the files read-only so they make sure of what they are deleting.

Regarding quotas, that really is the best way to do it - have you enabled quotas before? You have to turn quotas on for a DRIVE on the server, not on a per-folder basis. Then you can set limits and exclude users (think "Administrator") as you wish. Just want to make sure you really can't enable quotas before you write an entire different method in a script :) . If you know what you're doing and quotas really aren't available, then just skip this last paragraph ;)


"There are 10 types of people in this world - those who can read binary, and those who can't.""We've heard that a million monkeys at a million keyboards could produce the complete works of Shakespeare; now, thanks to the Internet, we know that is not true." ~Robert Wilensky0101101 1001010 1100001 1101101 1100101 1110011 0110011 1001101 10001110000101 0000111 0001000 0001110 0001101 0010010 1010110 0100001 1101110

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0