topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Thursday March 28, 2024, 12:17 pm
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Last post Author Topic: DONE: Move to Parent  (Read 22903 times)

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,277
    • View Profile
    • Donate to Member
DONE: Move to Parent
« on: September 25, 2010, 03:33 AM »
Move to Parent, a coding snack based on a request by nkormanik.

the context-menu item has been added but still only files are processed. use the older version to uninstall existing context-menu or shortcut.

MoveToParent_27_09_2010_001.png

MD5: 58CCED2BDE67879670610EA0111369F1
« Last Edit: September 27, 2010, 08:22 AM by lanux128 »

nkormanik

  • Participant
  • Joined in 2010
  • *
  • Posts: 552
    • View Profile
    • Donate to Member
Re: MoveToParent
« Reply #1 on: September 26, 2010, 01:38 AM »

Sorry for initially posting to the wrong thread.  For those just picking up, here was the request:

Quote from: nkormanik on September 25, 2010, 01:23:05 AM

Small program request:

Context menu item in Windows Explorer.

shortened name: "Move To Parent"

long name:  "Move Selected Items To Parent Directory"

In the old DOS days, it was easy to type in "move xyz.txt ..", or "move *.jpg .."

In Windows there is nothing similar.  And searching through Google turned up no simple program to accomplish this.

Can any of the gurus here do it?

Thanks,
Nicholas Kormanik


AndyM

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 616
    • View Profile
    • Donate to Member
Re: MoveToParent
« Reply #2 on: September 26, 2010, 10:15 AM »
You can add an item to the Folder Context menu thru the Folder Options dialog, File Types tab.

Find the Folder file type, click Advanced, and you'll see a button to add a New item.  Name it (eg MoveToParent) and have it call your short batch file (move "%1" ..), which you already wrote and named (eg moveparent.bat).

A word of caution.  The Folder (and File Folder) file types act a bit differently than other file types in the File Options dialogs.  For example, to delete a Context Menu entry for the Folder file type, you have to delete the registry key you created in the above process (easy to do).  For other file types (.txt, .doc, .xls, etc) the "Remove" key is not greyed out in the File Types Advanced dialog box the way it is for Folder and File Folder (hence the need to remove a menu item through the registry for Folders).


Sorry, none of what I said was wrong, but it answered the wrong question and was incorrect for what you need.  You'd want to modify the context menu for files, not folders, so the %1 parameter would point to the proper file.  This can be done, but not thru the File Types dialogs I don't think. 
« Last Edit: September 26, 2010, 10:28 AM by AndyM »

AndyM

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 616
    • View Profile
    • Donate to Member
Re: MoveToParent
« Reply #3 on: September 26, 2010, 10:40 AM »
Check out

HKEY_CLASSES_ROOT\AllFilesystemObjects\Shell

This is where you can add context menu items to all files.  I've added three over the years.  Two of them call batch files (one to reset the selected files' attribute bit, one to create a backup of the selected files) and one calls an .exe file which copies the selected file's full path to the clipboard.

Each menu entry is a key under HKEY_CLASSES_ROOT\AllFilesystemObjects\Shell which includes the menu name and the executable file to call.

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,277
    • View Profile
    • Donate to Member
Re: MoveToParent
« Reply #4 on: September 27, 2010, 08:19 AM »
@nkormanik: new version added in the 1st post, pls try this version. again do some tests with sample files first before committing important files. :)

nkormanik

  • Participant
  • Joined in 2010
  • *
  • Posts: 552
    • View Profile
    • Donate to Member
Re: Move to Parent
« Reply #5 on: September 27, 2010, 05:09 PM »

Thanks again lanux128.  I really like the new context menu position.  That's perfect.

Unfortunately, no go on folders still.  And some files do move, while others don't.

When selecting a small group of files and internet shortcuts, the shortcuts move to parent, while the files stay.

Selecting a single file, though, works fine.

Must be harder to accomplish than one would think, huh.  That's apparently why no one else in cyberland has yet done it.


Target

  • Honorary Member
  • Joined in 2006
  • **
  • Posts: 1,832
    • View Profile
    • Donate to Member
Re: Move to Parent
« Reply #6 on: September 27, 2010, 06:54 PM »
perhaps also see the file bucket thread...

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,277
    • View Profile
    • Donate to Member
Re: Move to Parent
« Reply #7 on: September 27, 2010, 09:11 PM »
Thanks again lanux128.  I really like the new context menu position.  That's perfect.

Unfortunately, no go on folders still.  And some files do move, while others don't.

When selecting a small group of files and internet shortcuts, the shortcuts move to parent, while the files stay.

Selecting a single file, though, works fine.

Must be harder to accomplish than one would think, huh.  That's apparently why no one else in cyberland has yet done it.

hmm.. that's strange what is your OS again?

btw i'm working on the folders, would be ready soon.

nkormanik

  • Participant
  • Joined in 2010
  • *
  • Posts: 552
    • View Profile
    • Donate to Member
Re: Move to Parent
« Reply #8 on: September 27, 2010, 09:21 PM »

Windows XP Pro, SP3, with pretty much all the latest updates.

Once again, very good placement on the context menu location.


lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,277
    • View Profile
    • Donate to Member
Re: Move to Parent
« Reply #9 on: October 02, 2010, 02:57 AM »
i'm flattered that long-time DoCo member, [user]Jibz[/user] has highlighted this coding snack in a recent blog post of his. 8)

http://www.hardtoc.c...rchives/198#more-198

nkormanik

  • Participant
  • Joined in 2010
  • *
  • Posts: 552
    • View Profile
    • Donate to Member
Re: Move to Parent
« Reply #10 on: October 02, 2010, 03:00 AM »

Well, you accomplished something that was quite needed.


bzeng

  • Supporting Member
  • Joined in 2008
  • **
  • Posts: 3
    • View Profile
    • Donate to Member
Re: Move to Parent
« Reply #11 on: November 21, 2010, 11:02 AM »
I've tried installing this utility on Win 7 Home Premium, but can't see that the install is successful.
The MS5 code verifies the downloaded file [ver. September 27, 2010], the install dialog box appears as shown in the first post above. I click the 'Install' button and it changes to 'Uninstall' and I close the dialog by clicking the red X. I open Win Explorer and look in any files context menu for any choice about moving to parent but don't see it.
I reboot and look again but still don't see it. I tried the same procedure with the anti-virus disabled, but same result. What am I doing wrong.

nkormanik

  • Participant
  • Joined in 2010
  • *
  • Posts: 552
    • View Profile
    • Donate to Member
Re: Move to Parent
« Reply #12 on: November 21, 2010, 08:57 PM »
This particular utility, while a good attempt at the challenge, is spotty.  Sometimes it works.  Most of the time it doesn't.  I uninstalled it after a few days of testing.

The idea of moving files, folders to the parent directory is a super one.  Too bad it's so difficult to successfully write a program that does this.

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,277
    • View Profile
    • Donate to Member
Re: Move to Parent
« Reply #13 on: December 15, 2010, 12:34 AM »
i came across an explorer shell add-on called SmartXplore that seems to be able do this function, based on the screenshot. i haven't tried this yet but someone who is interested in this feature could give it a try.



Source: http://www.addictive...ws-7-explorer-shell/

nkormanik

  • Participant
  • Joined in 2010
  • *
  • Posts: 552
    • View Profile
    • Donate to Member
Re: Move to Parent
« Reply #14 on: December 15, 2010, 01:02 AM »
Thank you for continuing to monitor possibilities, as the need still exists.

I've downloaded and am trying the program you recommended.  Only problem so far is that to activate the menu one is supposed to press the "third mouse button" --- well, I don't have a third mouse button.

Hmmmm.

Nicholas

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,277
    • View Profile
    • Donate to Member
Re: Move to Parent
« Reply #15 on: December 15, 2010, 01:14 AM »
... Only problem so far is that to activate the menu one is supposed to press the "third mouse button" --- well, I don't have a third mouse button.

that can be easily fixed with an AHK script. e.g. the following code will emulate middle-click with ctrl+left click

^LButton::MouseClick, Middle

what keys you want to use to emulate the middle-click? ;)

nkormanik

  • Participant
  • Joined in 2010
  • *
  • Posts: 552
    • View Profile
    • Donate to Member
Re: Move to Parent
« Reply #16 on: December 15, 2010, 01:19 AM »
Ctrl-Left Click would work just fine.

How do I get the program you mentioned to recognize that button sequence?

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,277
    • View Profile
    • Donate to Member
Re: Move to Parent
« Reply #17 on: December 15, 2010, 01:37 AM »
try this then.. :)

nkormanik

  • Participant
  • Joined in 2010
  • *
  • Posts: 552
    • View Profile
    • Donate to Member
Re: Move to Parent
« Reply #18 on: December 15, 2010, 01:52 AM »
Still no context menu comes up, such as in the picture.  Nothing.

Well, we tried.

Thanks!


lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,277
    • View Profile
    • Donate to Member
Re: Move to Parent
« Reply #19 on: December 15, 2010, 02:15 AM »
i see now that it's not part of the default package, there is a page for add-ons..


http://www.smartxplo...rtXplore?page=Addons

skwire

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 5,286
    • View Profile
    • Donate to Member
Re: Move to Parent
« Reply #20 on: December 15, 2010, 08:11 AM »
well, I don't have a third mouse button.

Do you have a mousewheel on your mouse?  If so, the "third button" they're talking about is usually accomplished by pressing the wheel button straight down (not (sc)rolling it down).  Make sense?

awopbamboo

  • Honorary Member
  • Joined in 2009
  • **
  • Posts: 118
    • View Profile
    • Donate to Member
Re: Move to Parent
« Reply #21 on: December 15, 2010, 08:46 AM »
Hi all

This seemed to be going on a bit, so I would like to stick in my 2 pen'nth worth.  Just a small little executable, stick it somewhere on your pc, set the path correctly in the .reg file. And, well, it should work...  It works for me...

If the 'install' is a little overcomplicated, let me know and I'll do a quick instal script.  Didn't think it would be worth it for an executable thats about 20k in size!

Let me know if it works... 

J.
_____________________________________________
J.

nkormanik

  • Participant
  • Joined in 2010
  • *
  • Posts: 552
    • View Profile
    • Donate to Member
Re: Move to Parent
« Reply #22 on: December 15, 2010, 04:42 PM »
Lord Skwire,  I sure WISH my mice did have that scroll wheel.  Maybe someday I'll replace these, but not yet.

nkormanik

  • Participant
  • Joined in 2010
  • *
  • Posts: 552
    • View Profile
    • Donate to Member
Re: Move to Parent
« Reply #23 on: December 15, 2010, 04:58 PM »
awopbamboo, best yet offered here.  Good job.  Works for one file or FOLDER at a time.

Multiple selected files or folders, no.

And some types of files (go figure, like pdfs), "Move To Parent" doesn't appear in right-click context menu.

But..., yours is definitely worth keeping installed.

(by the way, just in case one does install, and feels differently, you might want to include an uninstall to switch their registry back to how it was prior....)

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,277
    • View Profile
    • Donate to Member
Re: Move to Parent
« Reply #24 on: December 15, 2010, 07:43 PM »
This seemed to be going on a bit, so I would like to stick in my 2 pen'nth worth.  Just a small little executable, stick it somewhere on your pc, set the path correctly in the .reg file. And, well, it should work...  It works for me...

nice work, awopbamboo.. :up: