Add Custom Folder to My Computer or the Desktop

Create your own custom system folder, like "My Documents", that can not be deleted or renamed and place it on the desktop and My Computer.

Create the following series of keys and values in the registry at [HKEY_CLASSES_ROOT\CLSID] or [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID].

The GUID, globally unique identifier, can be a random number, in this example "FD4DF9E0-E3DE-11CE-BFCF-ABCD1DE12345" is used.

  1. Create a new key called [HKEY_CLASSES_ROOT\CLSID\{FD4DF9E0-E3DE-11CE-BFCF-ABCD1DE12345}] and set (Default) to equal the name of the folder e.g. "My Folder".
  2. Create a new sub-key under the main key called "DefaultIcon" (i.e. [HKEY_CLASSES...ABCD1DE12345}\DefaultIcon]) and set (Default) to equal the filename for the icon you want to display e.g. "c:\windows\myicon.ico".
  3. Create a new sub-key under the main key called "InProcServer32" (i.e. [HKEY_CLASSES...ABCD1DE12345}\InProcServer32]) and set (Default) to equal "shell32.dll", also create a new String value called "ThreadingModel" and set it to "Apartment".
  4. Create a set of sub-keys starting at the main key "Shell\Open My Menu\Command" (i.e. [HKEY_CLASSES...ABCD1DE12345}\Shell\Open My Folder\Command]) and set (Default) to equal the command to execute when clicked, in this case explorer, e.g. "explorer /root,c:\MyFolder".
  5. Create a set of sub-keys starting at the main key "ShellEx\PropertySheetHandlers\{FD4DF9E0-E3DE-11CE-BFCF-ABCD1DE12345}" (i.e. [HKEY_CLASSES...ABCD1DE12345}\ShellEx\PropertySheetHandlers\{FD4DF9E0-E3DE-11CE-BFCF-ABCD1DE12345}])
  6. Create a new sub-key under the main key called "ShellFolder" (i.e. [HKEY_CLASSES...ABCD1DE12345}\ShellFolder]) and create a new Binary value called "Attributes" and set it to "00 00 00 00".
  7. (Optional) To place the folder on the desktop add the following key:
    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\
    Explorer\Desktop\NameSpace\{FD4DF9E0-E3DE-11CE-BFCF-ABCD1DE12345}]
  8. (Optional) To place the folder in My Computer add the following key:
    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\
    Explorer\MyComputer\NameSpace\{FD4DF9E0-E3DE-11CE-BFCF-ABCD1DE12345}]

Now the folder cannot be deleted from the desktop or My Computer, nor can it be renamed other than removing the CLSID and the entries under NAMESPACE.

原帖地址:http://www.pctools.com/guides/registry/detail/73/

转载于:https://www.cnblogs.com/sun-li/archive/2010/01/18/1650895.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值