open selected file



  • Hi all.
    I have set a function key on my windows 7 machine to start Notepad++. Works as expected.
    I would like to find a way to use that key to open Notepad++ with the currently selected file from explorer.
    What I’m looking to do is select a file in explorer, hit the function key, and have the file open in Notepad++. I just can’t figure out what to pass on the command line for the selected file.
    Any ideas?

    Thanks in advance for any ideas,
    Kevin Fonda



  • @kfonda

    without knowing how you did it exactly, a common practice for explorer or registry tweaks is to
    use the %1 as a variable which gets replaced by the complete filename.

    Cheers
    Claudia



  • @Claudia-Frank

    What I did was to use the Logitech SetPoint software to set the function key to ‘Launch a Program’. I set the program to launch to
    "C:\Program Files (x86)\Notepad++\notepad++.exe" "%1"
    It looks like the command line doesn’t see a selected file as ‘%1’.
    I guess what I need is a way to access the name of the currently selected file from the command line.



  • @kfonda

    What I did was to use the Logitech SetPoint software to set the function key to ‘Launch a Program’

    OK, I guess this doesn’t work as long as the SetPoint program hasn’t a functionality to communicate with explorer/shell objects.

    I guess what I need is a way to access the name of the currently selected file from the command line.

    I didn’t use it myself but maybe AutoIt (or similar sw) might be helpful in such a case.
    Afaik AutoIt has the possibility to work with COM objects, if so it should be possible
    to get the running explorer and shell instance and get the selected file.

    Cheers
    Claudia


Log in to reply