Click here to Skip to main content
15,897,371 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
Hello,

How can I store any file as a system file??
And I also want to know that how can I make a file which can not be open by anyone.

Thanks in advance.
Posted
Updated 18-Oct-10 5:36am
v2
Comments
Dave Kreskowiak 18-Oct-10 11:52am    
You're going to have to describe what you mean by "system file". A file is a file is a file... The only thing that makes it a "system file" is the location it sits in the filesystem.

There is no way to make a file that cannot be opened by anyone. Since your application runs AS THE USER who launched it, that person will have to have permissions to open the file so you app can open the file.
OriginalGriff 19-Oct-10 11:38am    
"Can you explain what is the meaning of WOM??"
WOM is similar to ROM, but the other way around.
ROM: Read Only Memory
WOM: Write Only Memory
Most PCs are fitted with a significant amount of WOM for general use, but this is not much publicised as it is extremely difficult to accurately quantify the size, due to manufacturing tolerances.

There are very good reasons why it is not easy (or recommended) to "store any file as a system file" - most of them called "viruses". Think of something else.

As far as "make a file which can not be open by anyone." that is not possible at all - some processes / users will always be able to open any file, unless it is written to WOM: your PC will have an infinite amount of that fitted as standard. :laugh:

Instead, consider encrypting your file so it can't be read, and put it somewhere normal.
 
Share this answer
 
Comments
[no name] 19-Oct-10 11:26am    
thanks for your answer.

Can you explain what is the meaning of WOM??
There is a win32 API that you could try calling using DLLImport

SetFileAttrib

It is a bit dodgy though and may not work on all windows operating systems
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900