Click here to Skip to main content
15,881,776 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
I know how to hide files and different folders at System level using different file
attributes but I don't know how to hide theme at kernel level like Lock folder XP, so another application or our system command window(cmd) can not access it without permission.Is there any way to do this?
Posted

This will Hide the Selected Folders from the ListView


Private Sub HideFolders(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles HideToolStripMenuItem.Click
For i As Integer = 0 To ListView1.CheckedItems.Count - 1
If IO.File.GetAttributes(ComboBox1.SelectedItem + ":\" + ListView1.CheckedItems(i).Text) And IO.FileAttributes.System + IO.FileAttributes.Hidden Then
MessageBox.Show(ListView1.CheckedItems(i).Text + " is Already Hidden Click on Show Folders to Display It Again", "Hide Folders Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
Else
IO.File.SetAttributes(ComboBox1.SelectedItem + ":\" + ListView1.CheckedItems(i).Text, IO.FileAttributes.System + IO.FileAttributes.Hidden)
MessageBox.Show(ListView1.CheckedItems(i).Text + " Folder has been Hidden", "File Hidden", MessageBoxButtons.OK, MessageBoxIcon.Information)
End If
Next
End Sub


You may refers this link
<a href="http://www.dotnetspider.com/resources/20889-Hiding-Unhiding-Folders.aspx"></a>[<a href="" target="_blank"></a>]
 
Share this answer
 
Comments
Manoj K Bhoir 7-Nov-11 6:06am    
Thanx for your help.but if i hide folder using above code it is still accessible by cmd.
A Rootkit[^] can hide files at the kernel level, which means that nobody will be able to find them.

The usual way is is to handle this as SAKryukov suggests :)

Best regards
Espen Harlinn
 
Share this answer
 
Don't mix up hiding and permission. One of possible permissions is hiding a file from some users, but you can just prohibit opening the file, or make it read-only, etc. The number of different options is pretty big, see file Properties => Security => Advanced to get and idea. Permissions are based on the user identity.

For programmatic manipulations of permissions, see, for example, these articles:
http://emmet-gray.com/Articles/SetPermissions.htm[^],
http://www.dotnet247.com/247reference/msgs/28/144136.aspx[^],
http://www.nirajkachhadia.com/vbnet-programming.html[^].

See this MSDN help page with code sample:
http://msdn.microsoft.com/en-us/library/04f9s685%28v=VS.100%29.aspx[^].

—SA
 
Share this answer
 

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