DOS files attributes

Umc / V 1.7, 3.3, 3.4
August 5, 2010 at 07:37:31
Specs: DOS 7.10, AM486/120MHz/32Mb
Hi all guy´s. I want to know how to protect a file, using attrib. I want to protect some files from erasing, but not re-writtable, only protect them about unwanted erasing. Is it possible?

Best regards.

Osvaldo from Banfield, Buenos Aires, Argentina

If there is a possibility of several things going wrong, the one that will cause the most damage will be the one to go wrong.


See More: DOS files attributes

Report •

#1
August 5, 2010 at 08:26:06
You can possibly use the read only and system attributes. attrib +r +s drive:\path\file_name. You could also hide it you wanted to with +h. I'm not sure how secure the files would really be though... if someone really wanted to, the files would be easy enough to find/modify/delete.

Report •

#2
August 5, 2010 at 09:19:54
In a DOS system your options are very limited.
If the file must be writable really the only thing you can do is to set the hidden attribute with attrib +h drive:\path. This just means the file will not appear in directory listing with default settings. Very easy to get around.

Anything more than that and the file will not be writable. The protection will be very minimal. For anyone who understands file attributes this would be nothing more than a minor inconvenience if they wished to delete the file.


Report •

#3
August 5, 2010 at 11:49:48
Thanks to both.

"Anything more than that and the file will not be writable. The protection will be very minimal. For anyone who understands file attributes this would be nothing more than a minor inconvenience if they wished to delete the file."

In all cases, the files will be used only by me, this question is to prevent myself to delete a file I´ll need in the future.

Best regards.

If there is a possibility of several things going wrong, the one that will cause the most damage will be the one to go wrong.


Report •

Related Solutions

#4
August 5, 2010 at 18:40:16
Just use the advice given above then. You'll have to determine which files to apply the attrib +h attribute to. The reasoning is that if you can't see it, then you can't delete it.

Skip
Audares Juvo


Report •

#5
August 5, 2010 at 21:36:46
Attrib +r file name keeps it from being deleted or modified.
Attrib -r file name removes the read-only attribute so you can delete or modify it.

If you want to be able to locate it easily I wouldn't use the hidden (h) or system (s) attributes.

http://www.computerhope.com/attribh...

Now that's what I call a sticky situation


Report •

Ask Question