1

I would like to be able to add a windows context menu for a folder to rename the folder with a "." (period) in front of the folder name.

For example right clicking on a folder named "temporary files" and pressing a menu item called "Hide Folder" would rename the folder to ".temporary files".

It would be really cool if clicking the same menu option on ".temporary files" changed it back to "temporary files" but that is not necessary.

  • You do realise that prefixing a period doesn't hide the folder in Windows, right? – Karan May 17 '15 at 21:32
  • Yes, I do. I recently purchased a WD TV Media Player. Directories (folders) prefixed with a period are ignored or hidden in from it. It would be a time saver if I didn't have to run CMD.exe and manually rename directories that I wanted hidden from WD TV Media Player. Windows explorer will not allow such a rename to be made, but it can be done command line. – Brian Bates May 19 '15 at 11:08
  • Yes, the WD TV runs on Linux so this will work. – Karan May 19 '15 at 16:27
0

You can write a program or script which renames the folder and refer to it in the registry:

Context menu for right click on folders in left panel of Windows Explorer or on background of a directory in right panel:

  1. HKEY_CLASSES_ROOT\Directory\Background\shell - if you are administrator
  2. HKEY_CURRENT_USER\Software\Classes\directory\Background\shell - if you are a normal user

Context menu for right click on folders in right panel of Windows Explorer:

  1. HKEY_CLASSES_ROOT\Directory\shell - if you are administrator
  2. HKEY_CURRENT_USER\Software\Classes\directory\shell - if you are a normal user

Context menu for any file:

  1. HKEY_CLASSES_ROOT\\*\shell - if you are administrator
  2. HKEY_CURRENT_USER\Software\Classes\\*\shell - if you are a normal user

In all cases:

  1. Add a new key under "shell", naming it as you want to name the context menu item
  2. Add a new key inside this key, named command (mandatory name)
  3. Edit the "default" property in "command" to myprogrampath\path\path\executable.exe %1 to pass the file path and name of the selected file to your custom program

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.