What do you want to achieve by locking a folder? (As it is generally possible to lock a file, but not a folder, you'll have to devise a different way of doing it. We should start the discussion there.)
After re-reading your answer: do you want to disallow access to files your folder to prevent your software from being modified (hacked)? That could be achieved in a very limited way by modifying folder permissions, but in general this is impossible. An administrator can always override folder permissions on his own computer.
i want protect some softwares from others in the system
What does this mean? What do you mean by "protect"? Do you mean you don't want other software from reading the data or configuration information of some other software, or of the user? Of do you want to prevent some software from making changes to things it is not allowed to change? What do you mean by "others"? Other software? Other users?
Please be specific with what you want to accomplish! We can't help you if we don't know what you want to do!
lavanya airwala
Greenhorn
Joined: May 15, 2012
Posts: 3
posted
0
Martin Vajsar wrote:After re-reading your answer: do you want to disallow access to files your folder to prevent your software from being modified (hacked)? That could be achieved in a very limited way by modifying folder permissions, but in general this is impossible. An administrator can always override folder permissions on his own computer.
i have some original versions of softwares ,that's why i want protection for C folder software from other users ,not an admin
This is generally not feasible. A locally run software cannot resist a determined attack. To prevent this, you might place the sensitive code on a secured server and call it remotely (via webservices, for example).
If you want to protect your software from illegal redistribution, there might be licensing libraries/packages available. For Java applications, see http://www.coderanch.com/how-to/java/Java-FAQ#licensing. Again, these schemes cannot sustain a determined effort to break them.