0

System folder like My Document which appears in My computer are special folders which appear can not be deleted. Now i want to create something like that, a folder which cannot be deleted. I use the following way,and the folder is created success,but unfortunately i can't open it. So anybody can help me?

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\software\Classes\CLSID\{fd4df9e0-e3de-11ce-bfcf-abcd1de00000}]
 @=”IAMFOLDER”

[HKEY_LOCAL_MACHINE\software\Classes\CLSID\{fd4df9e0-e3de-11ce-bfcf-abcd1de00000}\defaulticon]

[HKEY_LOCAL_MACHINE\software\Classes\CLSID\{fd4df9e0-e3de-11ce-bfcf-abcd1de00000}\inprocserver32]
 @=”shdocvw.dll”
 “ThreadingModel”=”Apartment”

[HKEY_LOCAL_MACHINE\software\Classes\CLSID\{fd4df9e0-e3de-11ce-bfcf-abcd1de00000}\instance]
 “CLSID”=”{0afaced1-e828-11d1-9187-b532f1e9575d}”

[HKEY_LOCAL_MACHINE\software\Classes\CLSID\{fd4df9e0-e3de-11ce-bfcf-abcd1de00000}\instance\initpropertybag]
 “Attributes”=hex:15,00,00,00
 “Target”=”C:\\”

[HKEY_LOCAL_MACHINE\software\Classes\CLSID\{fd4df9e0-e3de-11ce-bfcf-abcd1de00000}\shellfolder]
 “Attributes”=hex:50,00,00,f0
 “WantsFORPARSING”=””

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\software\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{fd4df9e0-e3de-11ce-bfcf-abcd1de00000}]
shan
  • 51
  • 5

2 Answers2

0

Walkthrough for adding a Custom Folder under "This PC".

What you need:

  • A folder you'd like to add (in this sample, I'll use "C:\Projects").
  • An icon for said folder if you want to use a custom icon (in this sample, I'll use "C:\Projects\projects.ico")
  • A GUID (in this sample, I'll use "EB39BB71-9B3B-4C47-BB02-F35CFAED1685". It'll work for your first custom folder you add, but if you'd like to add more custom folders you'll need to create new GUIDs)

What you need to do:

  • A whole bunch of registry hacks.

    1. Navigate to [HKCR\CLSID]
    2. Create a new Key with the name "{EB39BB71-9B3B-4C47-BB02-F35CFAED1685}"
    3. Inside the Key [HKCR\CLSID{EB39BB71-9B3B-4C47-BB02-F35CFAED1685}] right click on "(Default)", select modify and specify the value "Projects".
    4. Inside the Key [HKCR\CLSID{EB39BB71-9B3B-4C47-BB02-F35CFAED1685}] right click and select "New > String Value". Call this new value "InfoTip" and give it the value "C:\Projects".
    5. Inside the Key [HKCR\CLSID{EB39BB71-9B3B-4C47-BB02-F35CFAED1685}] right click and select "New > DWORD (32 Bit) Value". Call this new value "System.IsPinnedToNameSpaceTree" and give it a value of "1".
    6. Inside the Key [HKCR\CLSID{EB39BB71-9B3B-4C47-BB02-F35CFAED1685}] right click and select "New > Key". Call this Key "DefaultIcon".
    7. Inside the Key [HKCR\CLSID{EB39BB71-9B3B-4C47-BB02-F35CFAED1685}\DefaultIcon] right click on "(Default)", select modify and specify the value "C:\Projects\projects.ico".
    8. Inside the Key [HKCR\CLSID{EB39BB71-9B3B-4C47-BB02-F35CFAED1685}] right click and select "New > Key". Call this Key "InProcServer32".
    9. Inside the Key [HKCR\CLSID{EB39BB71-9B3B-4C47-BB02-F35CFAED1685}\InProcServer32] right click on "(Default)", select modify and specify the value "%systemroot%\System32\shell32.dll".
    10. Inside the Key [HKCR\CLSID{EB39BB71-9B3B-4C47-BB02-F35CFAED1685}\InProcServer32] right click and select "New > String Value". Call this new value "ThreadingModel" and give it the value "Both".
    11. Inside the Key [HKCR\CLSID{EB39BB71-9B3B-4C47-BB02-F35CFAED1685}] right click and select "New > Key". Call this Key "Instance".
    12. Inside the Key [HKCR\CLSID{EB39BB71-9B3B-4C47-BB02-F35CFAED1685}\Instance] right click and select "New > String Value". Call this new value "CLSID" and give it the value "{0AFACED1-E828-11D1-9187-B532F1E9575D}". (This is the CLSID for "Folder Shortcut", if you try to add a different type of shortcut instead of a custom folder, you may need to lookup the right type of handler and find the CLSID for that).
    13. Inside the Key [HKCR\CLSID{EB39BB71-9B3B-4C47-BB02-F35CFAED1685}\Instance] right click and select "New > Key". Call this Key "InitPropertyBag".
    14. Inside the Key [HKCR\CLSID{EB39BB71-9B3B-4C47-BB02-F35CFAED1685}\Instance\InitPropertyBag] right click and select "New > DWORD (32 Bit) Value". Call this new value "Attributes" and give it the value "21".
    15. Inside the Key [HKCR\CLSID{EB39BB71-9B3B-4C47-BB02-F35CFAED1685}\Instance\InitPropertyBag] right click and select "New > Expandable String Value". Call this new value "Target" and give it the value "C:\Projects".
    16. Inside the Key [HKCR\CLSID{EB39BB71-9B3B-4C47-BB02-F35CFAED1685}] right click and select "New > Key". Call this Key "Shell".
    17. Inside the Key [HKCR\CLSID{EB39BB71-9B3B-4C47-BB02-F35CFAED1685}\Shell] right click and select "New > Key". Call this Key "Open Projects Folder"* (* You can put what you want in here, this is the menu option that appears when you right click on your custom added folder, just remember to modify step 18 as needed).
    18. Inside the Key [HKCR\CLSID{EB39BB71-9B3B-4C47-BB02-F35CFAED1685}\Shell\Open Projects Folder] right click and select "New > Key". Call this Key "Command".
    19. Inside the Key [HKCR\CLSID{EB39BB71-9B3B-4C47-BB02-F35CFAED1685}\Shell\Open Projects Folder\Command] right click on "(Default)", select modify and specify the value "explorer /root,C:\Projects".
    20. Inside the Key [HKCR\CLSID{EB39BB71-9B3B-4C47-BB02-F35CFAED1685}] right click and select "New > Key". Call this Key "ShellEx".
    21. Inside the Key [HKCR\CLSID{EB39BB71-9B3B-4C47-BB02-F35CFAED1685}\ShellEx] right click and select "New > Key". Call this Key "PropertySheetHandlers".
    22. Inside the Key [HKCR\CLSID{EB39BB71-9B3B-4C47-BB02-F35CFAED1685}\ShellEx\PropertySheetHandlers] right click and select "New > Key". Call this Key "{EB39BB71-9B3B-4C47-BB02-F35CFAED1685}".
    23. Inside the Key [HKCR\CLSID{EB39BB71-9B3B-4C47-BB02-F35CFAED1685}] right click and select "New > Key". Call this Key "ShellFolder".
    24. Inside the Key [HKCR\CLSID{EB39BB71-9B3B-4C47-BB02-F35CFAED1685}\ShellFolder] right click and select "New > DWORD (32 Bit) Value". Call this new value "Attributes" and give it the value "f080004d".
    25. Inside the Key [HKCR\CLSID{EB39BB71-9B3B-4C47-BB02-F35CFAED1685}\ShellFolder] right click and select "New > DWORD (32 Bit) Value". Call this new value "SortOrderIndex" and give it the value "0".
    26. Now navigate to [HKCR\Wow6432Node\CLSID].
    27. Create a new Key with the name "{EB39BB71-9B3B-4C47-BB02-F35CFAED1685}"
    28. Inside the Key [HKCR\Wow6432Node\CLSID{EB39BB71-9B3B-4C47-BB02-F35CFAED1685}] right click on "(Default)", select modify and specify the value "Projects".
    29. Inside the Key [HKCR\Wow6432Node\CLSID{EB39BB71-9B3B-4C47-BB02-F35CFAED1685}] right click and select "New > String Value". Call this new value "InfoTip" and give it the value "C:\Projects".
    30. Inside the Key [HKCR\Wow6432Node\CLSID{EB39BB71-9B3B-4C47-BB02-F35CFAED1685}] right click and select "New > Key". Call this Key "DefaultIcon".
    31. Inside the Key [HKCR\Wow6432Node\CLSID{EB39BB71-9B3B-4C47-BB02-F35CFAED1685}\DefaultIcon] right click on "(Default)", select modify and specify the value "C:\Projects\projects.ico".
    32. Inside the Key [HKCR\Wow6432Node\CLSID{EB39BB71-9B3B-4C47-BB02-F35CFAED1685}] right click and select "New > Key". Call this Key "InProcServer32".
    33. Inside the Key [HKCR\Wow6432Node\CLSID{EB39BB71-9B3B-4C47-BB02-F35CFAED1685}\InProcServer32] right click on "(Default)", select modify and specify the value "%systemroot%\System32\shell32.dll".
    34. Inside the Key [HKCR\Wow6432Node\CLSID{EB39BB71-9B3B-4C47-BB02-F35CFAED1685}\InProcServer32] right click and select "New > String Value". Call this new value "ThreadingModel" and give it the value "Both".
    35. Inside the Key [HKCR\Wow6432Node\CLSID{EB39BB71-9B3B-4C47-BB02-F35CFAED1685}] right click and select "New > Key". Call this Key "Instance".
    36. Inside the Key [HKCR\Wow6432Node\CLSID{EB39BB71-9B3B-4C47-BB02-F35CFAED1685}\Instance] right click and select "New > String Value". Call this new value "CLSID" and give it the value "{0AFACED1-E828-11D1-9187-B532F1E9575D}". (This is the CLSID for "Folder Shortcut", if you try to add a different type of shortcut instead of a custom folder, you may need to lookup the right type of handler and find the CLSID for that).
    37. Inside the Key [HKCR\Wow6432Node\CLSID{EB39BB71-9B3B-4C47-BB02-F35CFAED1685}\Instance] right click and select "New > Key". Call this Key "InitPropertyBag".
    38. Inside the Key [HKCR\Wow6432Node\CLSID{EB39BB71-9B3B-4C47-BB02-F35CFAED1685}\Instance\InitPropertyBag] right click and select "New > DWORD (32 Bit) Value". Call this new value "Attributes" and give it the value "21".
    39. Inside the Key [HKCR\Wow6432Node\CLSID{EB39BB71-9B3B-4C47-BB02-F35CFAED1685}\Instance\InitPropertyBag] right click and select "New > Expandable String Value". Call this new value "Target" and give it the value "C:\Projects".
    40. Inside the Key [HKCR\Wow6432Node\CLSID{EB39BB71-9B3B-4C47-BB02-F35CFAED1685}] right click and select "New > Key". Call this Key "ShellEx".
    41. Inside the Key [HKCR\Wow6432Node\CLSID{EB39BB71-9B3B-4C47-BB02-F35CFAED1685}\ShellEx] right click and select "New > Key". Call this Key "PropertySheetHandlers".
    42. Inside the Key [HKCR\Wow6432Node\CLSID{EB39BB71-9B3B-4C47-BB02-F35CFAED1685}\ShellEx\PropertySheetHandlers] right click and select "New > Key". Call this Key "{EB39BB71-9B3B-4C47-BB02-F35CFAED1685}".
    43. Now navigate to [HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace].
    44. Create a new Key with the name "{EB39BB71-9B3B-4C47-BB02-F35CFAED1685}"
    45. Open up Task Manager (Shortcut key is CTRL + SHIFT + ESC).
    46. Click on the "Details" tab.
    47. Find "explorer.exe".
    48. Right click "explorer.exe" and select "End Task".
    49. Once "explorer.exe" has ended, click "File > Run New Task".
    50. Type in "explorer" and hit enter. Explorer should now relaunch and take the new registry keys into consideration.
    51. If all is working, you should now have a new "Projects" folder in your left hand menu.

enter image description here

Arash Hatami
  • 5,297
  • 5
  • 39
  • 59
0

This PowerShell script does the job on Windows 10. It's not mine, but works fine. Just change the values in "Configuration" section.

# ##############################################################################
# Configuration
# ##############################################################################
$FolderName="Python"
$FolderLocation="%USERPROFILE%\Python"
$FolderHint="Python scripts"
$FolderIcon="C:\Python37\pythonw.exe,0"

# ##############################################################################
# Variables
# ##############################################################################
$MYCLSID=$([guid]::NewGuid().ToString("B").ToUpper())
$HKCU_CLSID="HKCU:\Software\Classes\CLSID\$MYCLSID"

# ##############################################################################
# 32bit
# ##############################################################################
New-Item -Path $HKCU_CLSID
Set-ItemProperty -Path $HKCU_CLSID -Name "(Default)" -Value $FolderName
Set-ItemProperty -Path $HKCU_CLSID -Name "InfoTip" -Value $FolderHint
Set-ItemProperty -Path $HKCU_CLSID -Name "DescriptionID" -Value 3 -type dword
Set-ItemProperty -Path $HKCU_CLSID -Name "System.IsPinnedtoNameSpaceTree" -Value 1 -Type DWORD

New-Item -Path $HKCU_CLSID\DefaultIcon
Set-ItemProperty -Path $HKCU_CLSID\DefaultIcon -Name "(Default)" -Value $FolderIcon

New-Item -Path $HKCU_CLSID\InProcServer32
Set-ItemProperty -Path $HKCU_CLSID\InProcServer32 -Name "(Default)" -Value "shdocvw.dll"
Set-ItemProperty -Path $HKCU_CLSID\InProcServer32 -Name "ThreadingModel" -Value "Both"

New-Item -Path $HKCU_CLSID\Instance
Set-ItemProperty -Path $HKCU_CLSID\Instance -Name "CLSID" -Value "{0afaced1-e828-11d1-9187-b532f1e9575d}"

New-Item -Path $HKCU_CLSID\Instance\InitPropertyBag
Set-ItemProperty -Path $HKCU_CLSID\Instance\InitPropertyBag -Name "Attributes" -Value 15 -Type DWORD
Set-ItemProperty -Path $HKCU_CLSID\Instance\InitPropertyBag -Name "Target" -Value $FolderLocation -Type ExpandString

New-Item -Path $HKCU_CLSID\ShellEx
New-Item -Path $HKCU_CLSID\ShellEx\PropertySheetHandlers
New-Item -Path "$HKCU_CLSID\ShellEx\PropertySheetHandlers\tab 1 general"
Set-ItemProperty -Path "$HKCU_CLSID\ShellEx\PropertySheetHandlers\tab 1 general" -Name "(Default)" -Value "{21b22460-3aea-1069-a2dc-08002b30309d}"
New-Item -Path "$HKCU_CLSID\ShellEx\PropertySheetHandlers\tab 2 customize"
Set-ItemProperty -Path "$HKCU_CLSID\ShellEx\PropertySheetHandlers\tab 2 customize" -Name "(Default)" -Value "{ef43ecfe-2ab9-4632-bf21-58909dd177f0}"
New-Item -Path "$HKCU_CLSID\ShellEx\PropertySheetHandlers\tab 3 sharing"
Set-ItemProperty -Path "$HKCU_CLSID\ShellEx\PropertySheetHandlers\tab 3 sharing" -Name "(Default)" -Value "{f81e9010-6ea4-11ce-a7ff-00aa003ca9f6}"
New-Item -Path "$HKCU_CLSID\ShellEx\PropertySheetHandlers\tab 4 security"
Set-ItemProperty -Path "$HKCU_CLSID\ShellEx\PropertySheetHandlers\tab 4 security" -Name "(Default)" -Value "{1f2e5c40-9550-11ce-99d2-00aa006e086c}"

New-Item -Path $HKCU_CLSID\ShellFolder
Set-ItemProperty -Path $HKCU_CLSID\ShellFolder -Name "Attributes" -Value 0xf080004d -type DWORD
Set-ItemProperty -Path $HKCU_CLSID\ShellFolder -Name "WantsFORPARSING" -Value ""
Set-ItemProperty -Path $HKCU_CLSID\ShellFolder -Name "HideAsDeletePerUser" -Value ""

# ##############################################################################
# 64bit
# ##############################################################################
if ([Environment]::Is64BitsOperatingSystem) {
    $HKCU_WOW6432Node_CLSID="HKCU:\Software\Classes\WOW6432Node\CLSID\$MYCLSID"

    New-Item -Path $HKCU_WOW6432Node_CLSID
    Set-ItemProperty -Path $HKCU_WOW6432Node_CLSID -Name "(Default)" -Value $FolderName
    Set-ItemProperty -Path $HKCU_WOW6432Node_CLSID -Name "InfoTip" -Value $FolderHint
    Set-ItemProperty -Path $HKCU_WOW6432Node_CLSID -Name "DescriptionID" -Value 3 -type dword
    Set-ItemProperty -Path $HKCU_WOW6432Node_CLSID -Name "System.IsPinnedtoNameSpaceTree" -Value 1 -Type DWORD

    New-Item -Path $HKCU_WOW6432Node_CLSID\DefaultIcon
    Set-ItemProperty -Path $HKCU_WOW6432Node_CLSID\DefaultIcon -Name "(Default)" -Value $FolderIcon

    New-Item -Path $HKCU_WOW6432Node_CLSID\InProcServer32
    Set-ItemProperty -Path $HKCU_WOW6432Node_CLSID\InProcServer32 -Name "(Default)" -Value "shdocvw.dll"
    Set-ItemProperty -Path $HKCU_WOW6432Node_CLSID\InProcServer32 -Name "ThreadingModel" -Value "Both"

    New-Item -Path $HKCU_WOW6432Node_CLSID\Instance
    Set-ItemProperty -Path $HKCU_WOW6432Node_CLSID\Instance -Name "CLSID" -Value "{0afaced1-e828-11d1-9187-b532f1e9575d}"

    New-Item -Path $HKCU_WOW6432Node_CLSID\Instance\InitPropertyBag
    Set-ItemProperty -Path $HKCU_WOW6432Node_CLSID\Instance\InitPropertyBag -Name "Attributes" -Value 15 -Type DWORD
    Set-ItemProperty -Path $HKCU_WOW6432Node_CLSID\Instance\InitPropertyBag -Name "Target" -Value $FolderLocation -Type ExpandString

    New-Item -Path $HKCU_WOW6432Node_CLSID\ShellEx
    New-Item -Path $HKCU_WOW6432Node_CLSID\ShellEx\PropertySheetHandlers
    New-Item -Path "$HKCU_WOW6432Node_CLSID\ShellEx\PropertySheetHandlers\tab 1 general"
    Set-ItemProperty -Path "$HKCU_WOW6432Node_CLSID\ShellEx\PropertySheetHandlers\tab 1 general" -Name "(Default)" -Value "{21b22460-3aea-1069-a2dc-08002b30309d}"
    New-Item -Path "$HKCU_WOW6432Node_CLSID\ShellEx\PropertySheetHandlers\tab 2 customize"
    Set-ItemProperty -Path "$HKCU_WOW6432Node_CLSID\ShellEx\PropertySheetHandlers\tab 2 customize" -Name "(Default)" -Value "{ef43ecfe-2ab9-4632-bf21-58909dd177f0}"
    New-Item -Path "$HKCU_WOW6432Node_CLSID\ShellEx\PropertySheetHandlers\tab 3 sharing"
    Set-ItemProperty -Path "$HKCU_WOW6432Node_CLSID\ShellEx\PropertySheetHandlers\tab 3 sharing" -Name "(Default)" -Value "{f81e9010-6ea4-11ce-a7ff-00aa003ca9f6}"
    New-Item -Path "$HKCU_WOW6432Node_CLSID\ShellEx\PropertySheetHandlers\tab 4 security"
    Set-ItemProperty -Path "$HKCU_WOW6432Node_CLSID\ShellEx\PropertySheetHandlers\tab 4 security" -Name "(Default)" -Value "{1f2e5c40-9550-11ce-99d2-00aa006e086c}"

    New-Item -Path $HKCU_WOW6432Node_CLSID\ShellFolder
    Set-ItemProperty -Path $HKCU_WOW6432Node_CLSID\ShellFolder -Name "Attributes" -Value 0xf080004d -type DWORD
    Set-ItemProperty -Path $HKCU_WOW6432Node_CLSID\ShellFolder -Name "WantsFORPARSING" -Value ""
    Set-ItemProperty -Path $HKCU_WOW6432Node_CLSID\ShellFolder -Name "HideAsDeletePerUser" -Value ""
}

# ##############################################################################
# Add to explorer
# ##############################################################################
New-Item -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\MyComputer -ErrorAction SilentlyContinue
New-Item -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace -ErrorAction SilentlyContinue
New-Item -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\$MYCLSID

# ##############################################################################
# Restart explorer
# ##############################################################################
Stop-Process -ProcessName explorer
Alexandre
  • 36
  • 3