How to paste shortcut to file by keystroke or command?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • MIRKOSOFT
    PCHF Member
    • Aug 2016
    • 203

    #1

    How to paste shortcut to file by keystroke or command?

    Hi!

    I have new mouse with more buttons.
    In mode 1 I added to two buttons functions Copy and Paste.
    I want to use else one button to Paste shortcut to file.
    This function is in Explorer and I donโ€™t know keystroke, if any hasโ€ฆ

    Is it possible to do by command or any keystroke?

    Thank you for all.
    Miro
  • Rustys
    PCHF Member
    • Jul 2016
    • 7862

    #2
    Key stroke for paste
    [ICODE]Ctrl+v[/ICODE]
    Key stroke for copy
    [ICODE]Ctrl+c[/ICODE]

    Comment

    • MIRKOSOFT
      PCHF Member
      • Aug 2016
      • 203

      #3
      No, this is normal, everybody knows these keystrokes Ctrl XCVโ€ฆ
      In File Explorer is button to Paste Shortcut (maybe incorrect translation from Slovak language9.
      Working this:
      Clipboard: C:\Program\test.exe
      normal paste copies test.exe to new location
      paste shortcut created link to test.exe in new location like: test.lnk
      Is it now understandable?

      Miro

      Comment

      • jmarket
        PCHF Owner
        • Jan 2015
        • 7634

        #4
        You can press
        [ICODE]Ctrl + Shift[/ICODE]
        to create a shortcut while dragging. That will create an .Ink file. Is this what you want? If not you can do
        [ICODE]Shift + F10[/ICODE]
        and thatโ€™ll pull up the right-click menu and you can manually click โ€œCreate Shortcutโ€

        Comment

        • MIRKOSOFT
          PCHF Member
          • Aug 2016
          • 203

          #5
          No, for correction:
          Each file in clipboard has also path where is stored.
          I need to create command or any keystroke (without drag&drop) to paste for this threa - link to file.
          Why command ?
          Iโ€™m using for remapping keyboard and mouse AHK scripting, I need to create anything like this:

          Of course drag&drop with holding left Alt creates lnk.
          I need it without drag&drop.
          Miro

          Comment

          • Rustys
            PCHF Member
            • Jul 2016
            • 7862

            #6
            Originally posted by MIRKOSOFT
            I want to use else one button to Paste shortcut to file.
            Why not Right click on the file and select Create Shortcut?

            Comment

            • MIRKOSOFT
              PCHF Member
              • Aug 2016
              • 203

              #7
              Simply why notโ€ฆ
              I want to paste shortcut to other location than location of fileโ€ฆ
              In Windows 10 file Explorer is button for this here:

              And it looks it has no keystroke.
              If you can help how to performthat action Iโ€™ll be happy.
              Miro

              Comment

              • jmarket
                PCHF Owner
                • Jan 2015
                • 7634

                #8
                Hi,
                For something like that, that will require scripting. That way, it does what YOU want. There is no keyboard command to paste a shortcut without triggering a D&D (Drag & Drop) or requiring another click. That requires scripting.

                Comment

                • MIRKOSOFT
                  PCHF Member
                  • Aug 2016
                  • 203

                  #9
                  OK, I try to create AHK script and if it will be successful I post it here and share with AHK community

                  Miro

                  Comment

                  • MIRKOSOFT
                    PCHF Member
                    • Aug 2016
                    • 203

                    #10
                    Hereโ€™s script which created GEV in AHK community:
                    Code:
                    clipboard := clipboard  ; convert clipboard to plain text (= copy the path of the copied file)
                    Sleep, 300
                    SplitPath, clipboard,,,, name_no_ext
                    IfWinActive, ahk_class Progman   ; desktop
                        FileCreateShortcut, %clipboard%, %A_Desktop%\%name_no_ext%.lnk
                    else
                    IfWinActive, ahk_class CabinetWClass   ; explorer
                    {
                        ; get current explorer path:
                        for window in ComObjCreate("Shell.Application").Windows
                        try Fullpath := % window.Document.Folder.Self.Path
                            FileCreateShortcut, %clipboard%, %Fullpath%\%name_no_ext%.lnk
                    }
                    I mean can help anybody in this forum too. Itโ€™s simple Paste shortcut script.
                    Thank you all for everything.
                    Miro

                    Comment

                    • jmarket
                      PCHF Owner
                      • Jan 2015
                      • 7634

                      #11
                      Most welcome I will mark this as Solved if thatโ€™s ok with you

                      Comment

                      • MIRKOSOFT
                        PCHF Member
                        • Aug 2016
                        • 203

                        #12
                        Of course, mark it as solvedโ€ฆ
                        Miro

                        Comment

                        • veeg
                          PCHF Director
                          • Jul 2016
                          • 8982

                          #13
                          Originally posted by MIRKOSOFT
                          Hereโ€™s script which created GEV in AHK community:
                          Code:
                          clipboard := clipboard ; convert clipboard to plain text (= copy the path of the copied file)
                          Sleep, 300
                          SplitPath, clipboard, name_no_ext
                          IfWinActive, ahk_class Progman ; desktop
                          FileCreateShortcut, %clipboard%, %A_Desktop%%name_no_ext%.lnk
                          else
                          IfWinActive, ahk_class CabinetWClass ; explorer
                          {
                          ; get current explorer path:
                          for window in ComObjCreate(โ€œShell.Applicationโ€).Windows
                          try Fullpath := % window.Document.Folder.Self.Path
                          FileCreateShortcut, %clipboard%, %Fullpath%%name_no_ext%.lnk
                          }
                          I mean can help anybody in this forum too. Itโ€™s simple Paste shortcut script.
                          Thank you all for everything.
                          Miro
                          Nice tip thanks..

                          Comment

                          • Rustys
                            PCHF Member
                            • Jul 2016
                            • 7862

                            #14
                            Originally posted by MIRKOSOFT
                            Of course, mark it as solvedโ€ฆ
                            Miro
                            Marked as solved.

                            Thank you for posting the script.

                            Comment

                            Working...