Saturday, November 10, 2012

Windows context menu – Flag directory

So I’ve been looking for a while an option to flag a directory with “Moved” folder.

Why would I need it? Well, for example, when downloading a torrent files, I would like to move some of the content but in the same time to keep the originals for seeding. So in order to remember what was moved and what wasn’t I would have to:

1. Create a new folder
2. Rename it to some name, like “Moved”

The fastest way to do this is by Ctrl+Shift+N and renaming.

Sounds simple, but when doing it a lot you start thinking about automation.
So here is a simple code which can update your registry to add 2 options:

1. Right click on any folder on the Windows Explorer side bar would have “Mark Moved” entry

ScreenClip
2. In the right click menu inside a folder, New menu would have “Mark Moved” entry

ScreenClip(1)

Copy the following to a text file, rename .txt to .reg and run.

Windows Registry Editor Version 5.00
 
[HKEY_CURRENT_USER\Software\Classes\.MarkMoved]
@="MarkMoved"
 
[HKEY_CURRENT_USER\Software\Classes\.MarkMoved\ShellNew]
"Command"="\"CMD\" /D /E:ON /c for /F \"tokens=*\" %%a IN (\"%1\") do md \"%%~dpa\\Moved\""
"nullfile"=hex:
 
[HKEY_CURRENT_USER\Software\Classes\MarkMoved]
"FriendlyTypeName"="Mark Moved"
 
[HKEY_CURRENT_USER\Software\Classes\MarkMoved\DefaultIcon]
@="shell32.dll,3"
 
[HKEY_CURRENT_USER\Software\Classes\MarkMoved\Shell\open]
"LegacyDisable"=hex:
 
[HKEY_CURRENT_USER\Software\Classes\MarkMoved\Shell\open\command]
@="."
 
 
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\shell\Mark Moved]
 
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\shell\Mark Moved\command]
@="CMD.EXE /C MD \"%1\\Moved\""
 

The information was merged form the following two sources:

http://advsurveying.com/blog/?p=186

http://stackoverflow.com/questions/4872786/adding-a-custom-new-folder-to-windows-explorer-context-menu

Next steps would be to add an icon to the explorer toolbar or ribbon.

Tested on Windows 8.

No comments:

Post a Comment