|
Answer» I want to add an option to my context menus, to be able to MOVE folders and files that I choose, by right-clicking on them, to a specific folder on my DESKTOP.
Before someone suggests it. I already know that adding the registry key
HKEY_CLASSES_ROOT\AllFilesystemObjects\shellex\ContextMenuHandlers\{C2FBB631-2971-11D1-A18C-00C04FD75D13}
will add the 'Move To' option to the context menu, but that is not how I want to do this. Mainly because when I do it this way, it causes an annoying glitch.
When I add this key, and I click on a hyperlink from within an Excel SPREADSHEET, it opens the 'Move Items' window, which allows you to browse for a folder or subfolder, to move a folder or file to, rather than opening the url or pathname for the hyperlink. It's really strange.
So I want to approach this a different way.
Here is what I have done so far.
For this experiment, I created TWO folders on my Desktop. One named 'Folder 1', and another named 'Folder 2', without the quotes. I also added a file named 'New Text Document.txt' to 'Folder 1' just to see if my experiment would move both 'Folder 1', and the 'New Text Document.txt' file together.
Then I added the following key to the registry
HKEY_CLASSES_ROOT\Directory\shell\Move to 'Folder 2'\command
And, I added the following data to the command key's (Default) string value
cmd /c move /-y "%1" "C:\Documents and Settings\Owner.A230N\Desktop\Folder 2"
Now, the option 'Move to 'Folder 2' shows up on my context menu.
Then, I right-click on 'Folder 1", choose the 'Move to Folder 2' option, and it moves 'Folder 1', with the text file, into 'Folder 2'.
It works fine, except that it renames 'Folder 1', to 'FOLDER~2', which is a truncated 8.3 short filename.
Can anybody explain why this is happening?
If I open a command prompt window, and enter the following two commands manually
cd "C:\Documents and Settings\Owner\Desktop"
and
move /-y "Folder 1" "C:\Documents and Settings\Owner.A230N\Desktop\Folder 2"
it moves the "Folder 1' folder to 'Folder 2', and keeps the name as 'Folder 1', without truncating it.
It seems to be a problem with the way the "%1" variable is handling the pathname to 'Folder 1', but I don't understand what it is. Or, is it a problem with trying to execute this command from within the registry?
Please help explain this to me.
ThanksAfter further investigation I have confirmed that the %1 variable is capturing the pathname in truncated FORM. Like this
C:\DOCUME~1\OWNER\Desktop\FOLDER~2
I don't know why it is doing this when I have the %1 variable in my command line surrounded with quotes. When the %1 variable is surrounded with quotes, shouldn't it capture the long pathname?
Like this
C:\Documents and Settings\Owner\Desktop\Folder 1
Is there something wrong with my syntax?
|