|
Answer» Hi Everybody!!
Is there a way to set the file properties/ATTRIBUTE or anything else so it will be locked by window or it can't be deleted.
Thanks, Jayattrib "filename" +R will make it read-only but Windows Explorer will still be able to delete it.
In XP Windows Explorer, as Administrator, right-click the file and choose "properties" and then the "security" tab and deny all permissions. Now nobody can do anything with it until you alter the permissions.
Code: [Select]I:\test\delfile>dir Volume in drive I is Various Volume Serial Number is 4040-A645
Directory of I:\test\delfile
09/05/2007 17:31 <DIR> .. 09/05/2007 17:31 <DIR> . 09/05/2007 17:31 14 hello.txt 1 File(s) 14 bytes 2 Dir(s) 32,720,904,192 bytes free
I:\test\delfile>attrib +R hello.txt
I:\test\delfile>del hello.txt I:\test\delfile\hello.txt ACCESS is denied.
I:\test\delfile>
Code: [Select]I:\test\delfile>attrib /? Displays or changes file attributes.
ATTRIB [+R | -R] [+A | -A ] [+S | -S] [+H | -H] [drive:][path][filename] [/S [/D]]
+ Sets an attribute. - Clears an attribute. R Read-only file attribute. A Archive file attribute. S System file attribute. H Hidden file attribute. [drive:][path][filename] Specifies a file or files for attrib to process. /S Processes matching files in the current FOLDER and all SUBFOLDERS. /D Processes folders as well.
I:\test\delfile>
If you are running an NTFS partition, you can set the Access Control (like choosing the security tab) by using the subinacl command. This command is part of the Windows Resorce Kit, or you can download from Microsoft at http://www.microsoft.com/downloads/details.aspx?FamilyId=E8BA3E56-D8FE-4A91-93CF-ED6985E3927B&displaylang=en
If you don't need permissions this strong, then the attrib command is perfect as suggested by contrex.
Post back if you need an example of subinacl.
|