Results 1 to 16 of 16

Thread: Registry: "Copies the current selection onto the clipboard" syntax.

  1. #1

    Thread Starter
    Junior Member scot-65's Avatar
    Join Date
    Mar 2013
    Posts
    16

    Registry: "Copies the current selection onto the clipboard" syntax.

    Is there a way to copy all the user highlighted items in the file manager
    (explorer) to the clipboard first before starting my little program?

    Will "daisy-chaining" the commands work?

    What is the syntax that will copy the highlighted files to the clipboard?

    HKCR\...\shell\My Program\command = "?%CopyToClipboard%?" "path\to\myprogram.exe"


    Name:  MTS-04-17.png
Views: 314
Size:  20.1 KB

    scot-65

  2. #2
    Still learning kebo's Avatar
    Join Date
    Apr 2004
    Location
    Gardnerville,nv
    Posts
    3,762

    Re: Registry: "Copies the current selection onto the clipboard" syntax.

    If you want to copy files in the explorer, highlight them and press control-c.
    Insofar as using the registry to copy things NO!. The registry is nothing but a huge repository of information used by the os. The first thing you should do is close the registry and never open it again until you know for sure what it is. You can give your self (or your admin) one heck of a headache by messing in the registry without knowing what you are doing.
    Process control doesn't give you good quality, it gives you consistent quality.
    Good quality comes from consistently doing the right things.

    Vague general questions have vague general answers.
    A $100 donation is required for me to help you if you PM me asking for help. Instructions for donating to one of our local charities will be provided.

    ______________________________
    Last edited by kebo : Now. Reason: superfluous typo's

  3. #3
    PowerPoster dunfiddlin's Avatar
    Join Date
    Jun 2012
    Posts
    8,245

    Re: Registry: "Copies the current selection onto the clipboard" syntax.

    If you issue a command to copy a file from Explorer to the clipboard, that's exactly what it does ... copies the file. You don't want to copy the file, you want to copy the filepaths and Windows doesn't have a built-in way of doing that. Or at least I think that's what you want. If you do actually want to move/copy files to a subfolder then Explorer already has a bunch of functions built in for that purpose so I'm not really sure why you wouldn't just use them.
    As the 6-dimensional mathematics professor said to the brain surgeon, "It ain't Rocket Science!"

    Reviews: "dunfiddlin likes his DataTables" - jmcilhinney

    Please be aware that whilst I will read private messages (one day!) I am unlikely to reply to anything that does not contain offers of cash, fame or marriage!

  4. #4

    Thread Starter
    Junior Member scot-65's Avatar
    Join Date
    Mar 2013
    Posts
    16

    Re: Registry: "Copies the current selection onto the clipboard" syntax.

    Quote Originally Posted by kebo View Post
    If you want to copy files in the explorer, highlight them and press control-c.
    Insofar as using the registry to copy things NO!. The registry is nothing but a huge repository of information used by the os. The first thing you should do is close the registry and never open it again until you know for sure what it is. You can give your self (or your admin) one heck of a headache by messing in the registry without knowing what you are doing.
    What I am looking for is the proper syntax that is represented by the following action in the file manager:

    Name:  516fe60b-.gif
Views: 132
Size:  7.8 KB

    or

    Name:  516fe676-.gif
Views: 125
Size:  1.3 KB

    I hope this is clear enough.

  5. #5
    Still learning kebo's Avatar
    Join Date
    Apr 2004
    Location
    Gardnerville,nv
    Posts
    3,762

    Re: Registry: "Copies the current selection onto the clipboard" syntax.

    look in the IO namescape....

    IO.File.Copy(souce, destination)
    IO.File.Move(sourceFileName,destination)
    IO.Directory.Move(sourceDirName,destination)
    Process control doesn't give you good quality, it gives you consistent quality.
    Good quality comes from consistently doing the right things.

    Vague general questions have vague general answers.
    A $100 donation is required for me to help you if you PM me asking for help. Instructions for donating to one of our local charities will be provided.

    ______________________________
    Last edited by kebo : Now. Reason: superfluous typo's

  6. #6
    Lively Member
    Join Date
    Jul 2011
    Posts
    65

    Re: Registry: "Copies the current selection onto the clipboard" syntax.

    Using kebo's suggestion above you could store that information in a temp string or in a hidden text doc and run it later.

  7. #7

    Re: Registry: "Copies the current selection onto the clipboard" syntax.

    ...and the documentation!

    System.IO.File.Copy
    System.IO.File.Move
    System.IO.Directory.Move

  8. #8

    Thread Starter
    Junior Member scot-65's Avatar
    Join Date
    Mar 2013
    Posts
    16

    Re: Registry: "Copies the current selection onto the clipboard" syntax.

    Quote Originally Posted by dunfiddlin View Post
    If you issue a command to copy a file from Explorer to the clipboard, that's exactly what it does ... copies the file. You don't want to copy the file, you want to copy the filepaths and Windows doesn't have a built-in way of doing that. Or at least I think that's what you want. If you do actually want to move/copy files to a subfolder then Explorer already has a bunch of functions built in for that purpose so I'm not really sure why you wouldn't just use them.
    I am investigating the clipboard.idataobject.getdata(dataformats.filedrop) method {syntax error, quick reply here}.

  9. #9

    Thread Starter
    Junior Member scot-65's Avatar
    Join Date
    Mar 2013
    Posts
    16

    Re: Registry: "Copies the current selection onto the clipboard" syntax.

    Quote Originally Posted by mholmes_3038 View Post
    Using kebo's suggestion above you could store that information in a temp string or in a hidden text doc and run it later.
    I wish to gather this information before the file manager (explorer) looses focus.

    Any ideas as to how to proceed?

    So by declaring HKCR\...\command = "System.IO.File.Copy" "path\to\myprogram.exe", this should work?



    Not giving up.

  10. #10
    Still learning kebo's Avatar
    Join Date
    Apr 2004
    Location
    Gardnerville,nv
    Posts
    3,762

    Re: Registry: "Copies the current selection onto the clipboard" syntax.

    I repeat, stay out of the registry... proceed at your own risk...

    I'm a bit confused about what you are trying to do, but to get the contents of a file explorer copy from your app you can use the following...

    Code:
    Public Function GetClipboardText() As String()
            Dim objClipboard As IDataObject = Clipboard.GetDataObject()
            If objClipboard.GetDataPresent(DataFormats.FileDrop) Then Return objClipboard.GetData(DataFormats.FileDrop)
        End Function
    that code will give you the file name/path of everything you copied from the file explorer
    Process control doesn't give you good quality, it gives you consistent quality.
    Good quality comes from consistently doing the right things.

    Vague general questions have vague general answers.
    A $100 donation is required for me to help you if you PM me asking for help. Instructions for donating to one of our local charities will be provided.

    ______________________________
    Last edited by kebo : Now. Reason: superfluous typo's

  11. #11

    Thread Starter
    Junior Member scot-65's Avatar
    Join Date
    Mar 2013
    Posts
    16

    Re: Registry: "Copies the current selection onto the clipboard" syntax.

    Quote Originally Posted by kebo View Post
    I'm a bit confused about what you are trying to do
    I have created a entry in the registry:
    HKCR\*\shell\move to subfolder\command = "path\to\myprogram.exe" "%1"
    However the %1 only passes the (highlighted) file that was targeted when I did the right-click.

    I want ALL files that are highlighted to be passed when I right-click and select the "move to subfolder" line.

    I do NOT want to right-click and "Copy", then right-click again to start my program.

    I DO want to combine the copy and starting of my program as one command.

    Still confused?

    As one command:
    HKCR\*\shell\move to subfolder\command = "[Ctrl]+C" "path\to\myprogram.exe" "%1"

    My original question:
    How to represent "[Ctrl]+C" in the above line?

  12. #12
    Still learning kebo's Avatar
    Join Date
    Apr 2004
    Location
    Gardnerville,nv
    Posts
    3,762

    Re: Registry: "Copies the current selection onto the clipboard" syntax.

    I have looked at this a bit more and you are dealing with limitation of the explorer rather than a .net programming issue. In this link surfasb mentions using the Send To context menu instead. It may be a better option for you.
    GL
    kevin
    Process control doesn't give you good quality, it gives you consistent quality.
    Good quality comes from consistently doing the right things.

    Vague general questions have vague general answers.
    A $100 donation is required for me to help you if you PM me asking for help. Instructions for donating to one of our local charities will be provided.

    ______________________________
    Last edited by kebo : Now. Reason: superfluous typo's

  13. #13

    Thread Starter
    Junior Member scot-65's Avatar
    Join Date
    Mar 2013
    Posts
    16

    Re: Registry: "Copies the current selection onto the clipboard" syntax.

    Quote Originally Posted by kebo View Post
    I have looked at this a bit more and you are dealing with limitation of the explorer rather than a .net programming issue. In this link surfasb mentions using the Send To context menu instead. It may be a better option for you.
    GL
    kevin
    Thank you for taking the time to research my inquiry.
    My VB skills are not enough to create a CLSID/dll's for a top level context-menu item at this time.
    Thanks again.
    scot-65

  14. #14
    PowerPoster dunfiddlin's Avatar
    Join Date
    Jun 2012
    Posts
    8,245

    Re: Registry: "Copies the current selection onto the clipboard" syntax.

    HKCR\*\shell\move to subfolder\command = "path\to\myprogram.exe" "%1"
    I dealt with this question in another thread recently. %1 gives you a single file option. %L will accept multiple files but it will open a separate instance of your program for each one. It does seem increasingly to me that you're reinventing the wheel here for no obvious gain over the Windows options. I do notice that you don't appear to have theCopy To Folder and Move To Folder options on your context menu which I would certainly recommend activating (most Windows 'tweakers' will see to that for you).
    As the 6-dimensional mathematics professor said to the brain surgeon, "It ain't Rocket Science!"

    Reviews: "dunfiddlin likes his DataTables" - jmcilhinney

    Please be aware that whilst I will read private messages (one day!) I am unlikely to reply to anything that does not contain offers of cash, fame or marriage!

  15. #15

    Thread Starter
    Junior Member scot-65's Avatar
    Join Date
    Mar 2013
    Posts
    16

    Re: Registry: "Copies the current selection onto the clipboard" syntax.

    Quote Originally Posted by dunfiddlin View Post
    I dealt with this question in another thread recently. %1 gives you a single file option. %L will accept multiple files but it will open a separate instance of your program for each one. It does seem increasingly to me that you're reinventing the wheel here for no obvious gain over the Windows options. I do notice that you don't appear to have theCopy To Folder and Move To Folder options on your context menu which I would certainly recommend activating (most Windows 'tweakers' will see to that for you).
    Yes sir, I am inventing a better mouse trap. Also learning how to program in VB. Explorer is fine.

    Suppose a folder contains 1000+ files. Imagine unloading a digital camera with large capacity.
    Mixed inside the numerous pictures are a few pictures of my wife's cooking - scattered everywhere.
    I wish to filter out these pictures of my wife's dishes from the large list of pictures in the folder.
    How many mouse clicks/keyboard actions will it take to move a group of these pictures to a subfolder?

    1) Now imagine highlighting the desired files.
    2) Right-click and select Move to Subfolder. A small App opens and the Textbox displays last folder entered.
    3) Either accept [Enter] the folder name or type a new/existing folder name and [Enter].
    Program processes, Textbox value is saved, dialog closes, focus goes back to explorer, and last known
    position in explorer is not lost.

    If the left pane of explorer is in tree view, and one tries to drag and drop, the list pane does sometimes
    jump, and last known position can be lost. If the subfolder count is rather long in the tree view, there is
    a chance the files may drop into an undesirable folder. Been there, done that, let's find a better way.


  16. #16
    PowerPoster dunfiddlin's Avatar
    Join Date
    Jun 2012
    Posts
    8,245

    Re: Registry: "Copies the current selection onto the clipboard" syntax.

    Again .... Copy To Folder and Move To Folder ... are available already.
    As the 6-dimensional mathematics professor said to the brain surgeon, "It ain't Rocket Science!"

    Reviews: "dunfiddlin likes his DataTables" - jmcilhinney

    Please be aware that whilst I will read private messages (one day!) I am unlikely to reply to anything that does not contain offers of cash, fame or marriage!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width