Reputation: 4150
Hi guys I am Using CreateNewFile() function to make a .txt file I them Hide it using the Following Code In System32 Directory.
Process p = Runtime.getRuntime().exec("attrib +h " + f.getPath());
p.waitFor();
The File is getting Hidden successfully But I need it to be secure so that you cannot delete it even if you wanted to. Is there a way to achieve this Programmatically?
Upvotes: 0
Views: 1036
Reputation: 7899
I don't think so
You can do it. Every file can be deleted somehow in windows(booting in safe mode).
Upvotes: 2
Reputation: 19185
The only way is to use Username
while creating File. You can not delete file created by other user unless you are administrative.
You will find More information Undeletable Folder in java
Upvotes: 0