Solved

Is there a way to prevent an Excel file from being deleted?

Posted on 2013-12-05
18
283 Views
Last Modified: 2013-12-30
Is there a way to prevent an Excel file from being deleted?
0
Comment
Question by:Conernesto
18 Comments
 
LVL 19

Expert Comment

by:jss1199
ID: 39699424
Assume it is on a file server or your local machine?

1.  Right-click the file you want to protect (I'm using c:\users\username\documents\myexcel.xlsx) and choose Properties.

2.  On the Security tab, click Advanced.  The 'Advanced Security Settings for Pictures' dialog options.

3.  Click the Change Permissions... button.

4.  Click the Add... button, and type "everyone" (no quotes) into the box, then click OK.  A 'Permission Entry' dialog appears.

5.  Scroll to the bottom.  Place a checkmark in the 'Deny' column for "Delete".  Do not add any other checkmarks.

6. Click OK.

7.  Click OK.

Windows will set the deny delete permission on this file.
Note: Deny permissions take precedence over allow permissions, so no one will be able to delete any file until/unless this permission item is removed.  This will block other apps from being able to delete either.
0
 

Author Comment

by:Conernesto
ID: 39699438
I have about 100 excel spreadsheets inside a folder that I want to protect from being deleted. Do I need to do the above steps for each or is there a faster way?
0
 
LVL 19

Expert Comment

by:jss1199
ID: 39699465
Perform the steps on the parent folder - it will protect all the files within that folder.
0
ScreenConnect 6.0 Free Trial

Check out the updates in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI that improves session organization and overall user experience. See the enhancements for yourself!

 
LVL 6

Expert Comment

by:Spyder2010
ID: 39699472
You can set the above mentioned permission on the folder that contains the spreadsheets.  It will inherit down to all the files within the folder
0
 

Author Comment

by:Conernesto
ID: 39699728
I have subfolders in side the folder that has the Excel worksheets. Is there a way to protect the folder contentets without protecting the PDF folders?
0
 
LVL 19

Expert Comment

by:jss1199
ID: 39699740
You would have to set the deny permission at the folder level, and then on each PDF folder remove the Deny permission.

Or rearrange your folders to more easily allow the deny permission to only apply to the folders you wish :)
0
 

Author Comment

by:Conernesto
ID: 39701486
Can an Access Database be protected from being deleted?
0
 

Author Comment

by:Conernesto
ID: 39701560
I went ahead and set the permission on the folder to deny as instructed above. I then went into the folder and tried to delete a file and the file was deleted. Did I do something wrong?
0
 

Author Comment

by:Conernesto
ID: 39701627
When I select delete, I get a message Are you sure you want to send this to the recycle bin?
The file is then deleted.
0
 
LVL 19

Expert Comment

by:jss1199
ID: 39701668
Since you are making this change to a folder, there is one additional items you need to check.

1. When adding the delete permission, Select the checkbox that says Replace all child object permissions with inheritable permissions from this object.  See attached screenshot

screenshot of dialog box
0
 

Author Comment

by:Conernesto
ID: 39701910
I can't seem to get both of ther above check boxes to stay. I check both check boxes and click on apply and one of the check boxes gets unchecked.
0
 
LVL 19

Expert Comment

by:jss1199
ID: 39701942
That is fine. It is supposed to unchecked after you apply. Can you test delete?
0
 

Author Comment

by:Conernesto
ID: 39702130
I did the test. I saved an Excel wb and I was able to delete it. I was also able to delete the folder?
0
 
LVL 19

Expert Comment

by:jss1199
ID: 39702135
Deny delete was applied to everyone?
0
 

Author Comment

by:Conernesto
ID: 39702144
Yes.
0
 

Author Comment

by:Conernesto
ID: 39706253
Attached are two files. A-Protect.xlsx is an Excel workbood. I protedted this file but I am still able to deleted. the second attachment is a zip file that contains one folder. I also protected this file but I am able to deleted. Can you please reveiw and let me know what I did wrong?
A-Protect.xlsx
A-Protect.zip
0
 
LVL 12

Accepted Solution

by:
Harry Lee earned 500 total points
ID: 39721919
Conernesto,

you have to test the delete with another login account. Since you are the administrator (who can change the permission of the files), you can always delete the files and folders.

In fact, all login names under the Administrators group can delete the files and folders. If you don't want yourself to be able to delete the files, you will have to lock the file permission to only SYSTEM.

System administrators can almost always delete the files, as long as you know how to.

If you really want nobody, including yourself and all the administrators, to not able to delete the files, you have to give Full Control access, of the files, only to SYSTEM.

To do so, you have to remove delete access of Administrators, Everyone, and Creator Owners. And of course, you have to remove Delete access for all other user class accounts.

One thing to watch out, you can accidentally loose control of the files yourself.
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

Introduction This Article is a follow-up to my Mappit! Addin Article (http://www.experts-exchange.com/A_2613.html), it was inspired by an email posting I made to EUSPRIG (http://www.eusprig.org/index.htm), I will briefly cover: 1) An overvie…
This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa‚Ķ

803 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