tested with XP SP3
important is what you send to DOS console when copy ( depending language )
(I think)
English
-Edit
-Select All
means
SendInput !{Space}es{Enter}
German
-Bearbeiten
-Alles Markieren
means
SendInput !{Space}ba{Enter}
Code:
;-- this copies a DOS-window to notepad -
f2=%a_scriptdir%\CopyDos.txt
Run, %ComSpec% /k ,,,PIDD
WinActivate ahk_pid %PIDD%
WinWaitActive ahk_pid %PIDD%
ifwinexist,ahk_pid %PIDD%
{
sleep,500
ControlSend, ,CLS,ahk_pid %PIDD%, , , ;send clear screen
ControlSend, ,{enter},ahk_pid %PIDD%, , , ;send enter
sleep,500
ControlSend, ,dir,ahk_pid %PIDD%, , , ;send Dos command dir
ControlSend, ,{enter},ahk_pid %PIDD%, , , ;send enter
sleep,1500
ClipBoard =
SendInput !{Space}es{Enter} ; <<<< important select/copy DOS english
;SendInput !{Space}ba{Enter} ; select/copy DOS german
ClipWait 2
C2:=clipboard
Fileappend,%C2%,%f2% ;-- write copied DOS-window to a file
run,%f2%
}
return
another example
Code:
;-- example send to DOS window dir command hidden ----
;SetKeyDelay,10,10,
SendMode, Input
DetectHiddenWindows On
SetTitleMatchMode 2
F1="%A_scriptdir%\test55.txt"
DosCommand=dir>%f1%
Run %ComSpec% /k %DosCommand%,,hide,PID1
WinWait %ComSpec% ahk_pid %PID1%
WinActivate ahk_pid %PID1%
ControlSend,,%doscommand% ,ahk_pid %PID1%
sleep,1000
process,close,%PID1%
run,%f1%
exitapp