Copy full path in File Explorer with AutoHotkey

The following AutoHotkey script will copy the full path & the file names selected in File Explorer.

I use everyday many times. Just press the F12 key!

Macro explained posted in https://www.gonduana.com/como-copiar-los-nombres-de-archivos-con-autohotkey (in plain Spanish, sorry)

; Copy full path & the file names selected in File Explorer
; www.gonduana.com/.../
#IfWinActive ahk_exe explorer.exe
F12 up::
    MouseGetPos, , , , myControl
    controlsTop := "NetUIHWND1 UIRibbonWorkPane1 ToolbarWindow323 DirectUIHWND1 ToolbarWindow324 ToolbarWindow321 Edit1 UpBand1 DirectUIHWND2"
    if (myControl = "DirectUIHWND3")
        CopyFileNamesExplorer()
    else if InStr(controlsTop, myControl)
        CopyPathExplorer()
return

CopyFileNamesExplorer()
{
    clipboard =
    SendInput, {Control Down}c{Control Up}
    ClipWait, 0
    Clipboard := RegExReplace(Clipboard, "m)^.+\\", "")
    Sort, Clipboard
    MsgBox, 64, File names to Clipboard, %Clipboard%
}

CopyPathExplorer()
{
    ControlGetText, path, ToolbarWindow323, A    
    pos := InStr(path, ": ")
    path :=  SubStr(path, pos+2)
    Clipboard := path
    MsgBox, 64, Path to Clipboard, %Clipboard%
}
#IfWinActive

Parents Reply Children
No Data