Link to home
Start Free TrialLog in
Avatar of maxb
maxb

asked on

Make app undeletable

Hi there,
How do I lock files to make them undeletable at the file level? I saw another protection app do this (something with NTFS?)

Thanks for any pointers!
Max
Avatar of shaneholmes
shaneholmes

FileSetAttr('MyFile.sys', faReadOnly or faSysFile);

FileSetAttr returns zero if the function was successful. Otherwise the return value is a Windows error code.


Shane
Avatar of maxb

ASKER

so where would this go on c:\test.exe ? so it can't be deleted unless its allowed (by running the app again and allowing deletion)
ASKER CERTIFIED SOLUTION
Avatar of shaneholmes
shaneholmes

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of maxb

ASKER

Will this work on all win98+ ?


Yes! - This is basic File manipulation stuff. Did you test it?

Shane
Avatar of maxb

ASKER

I'm not able to test it... trust you though :)
OK, well let me know if you have any trouble...

Shane