Solved

NTFS Permissions to allow delete of file, but not delete of file if done from containing folder

Posted on 2009-03-30
4
1,210 Views
Last Modified: 2013-12-02
Our file server contains many MS Word and Excel files, which need to be able to be deleted to allow editing. ie temp doc with changes. On save the old file is deleted. The new one is renamed with filename.

I have set for only files to be able to be deleted, but not folders. The issue arises that if someone clicks delete on the folder containing  the files then the files delete until an error pops up when a folder or the containing folder cannot be deleted.
* This also occurs if an accidental drag and drop of a folder is made and contents are moved until a folder that cannot be moved is reached.

 Is there a way to only allow files to be deleted if they are explicitly selected for deletion?
0
Comment
Question by:littlehogarth
  • 2
  • 2
4 Comments
 
LVL 18

Accepted Solution

by:
BigSchmuh earned 500 total points
ID: 24062052
You can set NTFS permissions on files depending on the ACL (Access control List is a list of Users, Groups and SpecialSystemComponents and their specific rights on each files/folders)

The user/group/context does not change depending on a "File selection"...so NTFS permissions can NOT DO what you want it to :-(

One smart hack can be to create a zero length hidden non-deletable file named !!!.txt in every folder.
==> ! is ascii (33) and will be moved/deleted at the earliest stage possible...thus blocking every "folder move/deletion"
0
 

Author Comment

by:littlehogarth
ID: 24256852
Thanks mate, your hack of using !!!.txt works ok. Trust Microsoft to create file types that need delete capability just to edit. Fits nicely with their NTFS file permissions.

The issue remains that if a user accidently drags a folder (1) and drops it on to another folder (2) then a new folder (copy of 1) is created in folder (2) even though the !!!.txt stops any files from transferring.
Therefore I get:
C:/folder 1/(files)
C:/folder 2/folder 1/(empty)        

Another issue is how to assign permissions to !!!.txt so the owner of the folder can still move the folder.  
0
 
LVL 18

Expert Comment

by:BigSchmuh
ID: 24258147
Can you write an admin procedure to periodically scan the full drive seeking for :
-empty folders to be deleted (you don't care if this is not a copy because an empty folder is always a very frustrating folder)
-folders without their !!!.txt...assigning specific NTFS permissions (depending on folder owner) to it

Using WSH or VBA or any script based languages would perfectly worked and allow for a basic maintenance.
0
 

Author Closing Comment

by:littlehogarth
ID: 31618487
Thanks BigSchmuh. Great suggestions. I'll flex my scripting muscle and see if I can get a positive result.
0

Featured Post

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Problem: Windows 32bit running out of paging space. Solution: Add additional page files on separate partitions. Background: By default Windows creates only one page file on the partition you install Windows on. You may know that the maximu…
Preface There are many applications where some computing systems need have their system clocks running synchronized within a small margin and eventually need to be in sync with the global time. There are different solutions for this, i.e. the W3…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now