Friday, August 14, 2009

Create A Special Folder In Windows Explorer

We can create a folder like My Documents one that will appear as a system folder in XP by doing the following steps...

1.In the Registry Editor, navigate to HKEY_CLASSES_ROOT\CLSID. Create a new1 key with a Globally Unique Identifier(GUID). The GUID is a 128-bit identifier that is usually generated by Windows. This can be a random number that is used touniquely identify COM objects. Create a key using this random GUID:{FD4DF9E0-E3DE-11CE-BFCF-ABCD1DE12345}

2.Set the value of the “(Default)” setting for this key to the name of the folder, say “My Personal Data”. Create a new sub-key under the main key and call it “DefaultIcon”. That is, create a key called:HKEY_CLASSES_ROOT\CLSID\{FD4DF9E0-E3DE-11CE-BFCFABCD1DE12345}\
DefaultIcon
Set the value of “(DefaultIcon)”to the filename and path of the icon file you want to use for the folder, for example,“C:\Topsec.ico”, without the quotes. If you don’t specify a path to an iconfile, Windows will use its default folder icon instead.

3 .Create another sub-key under the main key called “InprocServer32”, that is, create the
key called HKEY_CLASSES_ROOT\CLSID\{FD4DF9E0-E3DE-11CE-BFCF-ABCD1DE12345}\
InprocServer32
Set the“(default)” setting here to“shell32.dll”.Create another string value called ThreadingModel and set its value to “Apartment”. There’s one more: create another sub-key called
HKEY_CLASSES_ROOT\CLSID\{FD4DF9E0-E3DE-11CE-BFCF-ABCD1DE12345}\Shell\
Open MyFolder\Command
Set the “(Default)” value here to the command that should be executed when the folder is clicked. In this case, it would be “explorer /root,c:\My Personal Data”.

4.There’s more keys to be created:
HKEY_CLASSES_ROOT\CLSID\{FD4DF9E0-E3DE-11CE-BFCF-ABCD1DE12345}\ShellEx\
PropertySheetHandlers\{FD4DF9EO-E3DE-11CE-BFCF-ABCD1DE12345} and

HKEY_CLASSES_ROOT\CLSID\{FD4DF9E0-E3DE-11CE-BFCF-ABCD1DE12345}\
ShellFolder. Under this key, create a new binary value called“Attributes” with the value
“00 00 00 00”.

5.To place the folder in My Computer, add the original key to
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\
MyComputer\Namespace\
So the key value will be
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\
MyComputer\Namespace\{FD4DF9E0-E3DE-11CE-BFCF-ABCD1DE12345}

Now go to My Computer, and you’ll see a new custom folder!

No comments:

Post a Comment