views:

1630

answers:

8

I want to develop a program that can hide a folder. Not a hidden attribute, but a real hiding so that no applications can find it. I think for that I need to create a file system driver.

How can I do it in C#?

+6  A: 

You can't do it in C#.

You may find these videos interesting. Inside file system filters Part1 & Part2.

Matt Davison
+2  A: 

If you want privacy, you might be best to write an app that can encrypt a folder so that no other program can read it.

ck
A: 

What about using the system attribute on the folder?

When you want to use your own file system you will also need a separate partition. An example are e.g. recovery tools on pre-installed Windows system which are installed in a separate hidden partition.

0xA3
+4  A: 

This is going to take a ton of work, and you are most likely going to end up corrupting your file system. Maybe you can tell us the 50,000 foot view of what you are trying to accomplish by hiding these folders.

Such as what is the need to hide these folders? They are just going to be hidden from users of the computer, but any software that reads the disc drive for recovery will still be able to read them, is this acceptable? Why isn't encryption with a hidden flag just as good?

Nick Berardi
rootkit-like behaviour as Sony found is a) detectable b) utterly hated by end-users if discovered. If this was for commercial purposes I'd skip doing it.
stephbu
A: 
// Get Application start up path
string path = Application.StartupPath;
// Create Batch File Path
string filePath = path + "\\Hide.bat";
// Write syntex to write in BAtch File
string strToWrite = "attrib +h +s " + '"' + path + '"';
// Create Batch File
FileStream fs = new FileStream(filePath, FileMode.Create);
StreamWriter sw = new StreamWriter(fs);
sw.WriteLine(strToWrite);
sw.Close();
fs.Close();
The OP asked for 'Not a hidden attribute'.
Pourquoi Litytestdata
A: 

I think i have to create a file system filter driver for what i really want. Its not just changing attribute

Priyan R
+1  A: 

May I suggest just downloading a rootkit instead of trying to build one from scratch?

Justice
Or get one from Sony :)
Brian Rasmussen
A: 

Take a look at Dokan (dokan-dev.net) and see if that works for you.

DC