also an example , send2dos ( active folder )
Code: Select all
;- DOScommandhere / active folder
#Warn
setworkingdir,%a_scriptdir%
$F9::
dirx:=""
gosub,a1
e4x=
(Ltrim join&
@echo off
echo date=
date /t
echo time=
time /t
)
;Run, %COMSPEC% /T:0E /k "title %dirx% & mode con cols=140&%e4x%",%dirx%
Run, %COMSPEC% /T:70 /k "title %dirx% & mode con cols=140&%e4x%",%dirx% ;- see opened active folder in title
Winwait,ahk_class ConsoleWindowClass
WinMove,ahk_class ConsoleWindowClass,, 0,0
sleep,400
controlsend,ahk_parent,{text}ver`n,ahk_class ConsoleWindowClass
controlsend,ahk_parent,{text}dir`n,ahk_class ConsoleWindowClass
return
a1:
;- tmplinshi / DOScommandhere WIN11 https://www.autohotkey.com/boards/viewtopic.php?p=33858#p33858
If WinActive("ahk_class CabinetWClass") || WinActive("ahk_class ExploreWClass")
dirx:=""
WinHWND := WinActive()
For win in ComObjCreate("Shell.Application").Windows
If (win.HWND = WinHWND)
{
dirx := SubStr(win.LocationURL, 9) ; remove "file:///"
dirx := RegExReplace(dirx, "%20", " ")
Break
}
if dirx=
dirx:=a_desktop
return
;==================================================================================