Hi all,
I remember sometime in the past year seeing a script that had a Gui control either embedding a console (Windows command prompt) in a control (Edit box? ActiveX? ComObj?) or mimicking it. The (faux?) console window had the same white background as an edit control, but functioned just like the DOS command prompt.
I have looked through hundreds (it seems like) of links involving CmdRet, ConsoleSend, StdOutToStream, and so on, without finding what I remembered. I found one today by Lexikos that is _almost_ it, but it shows the generic black DOS window. (https://autohotkey.com/board/topic/4230 ... ntry264010).
If this rings any bells, I'd sure appreciate a link!
Thanks a million,
burque505
Lost script: Windows CMD shell in Gui control Topic is solved
- Masonjar13
- Posts: 1555
- Joined: 20 Jul 2014, 10:16
- Location: Не Россия
- Contact:
Re: Lost script: Windows CMD shell in Gui control
Haven't seen such, but you should be able to do that yourself by using FileOpen to open the StdIn and StdOut for the process. Info on usage of the returned file objects can be found on the File Object page.
Re: Lost script: Windows CMD shell in Gui control
Thanks for the tips, Masonjar13. Getting closer.
There's a nice tutorial at Writing Command-Line Programs in AutoHotkey by Shambles that brings up the same points you have regarding FileOpen.
Regards,
burque505
p.s. For some reason the fact I can't find that script again is driving me nuts.
There's a nice tutorial at Writing Command-Line Programs in AutoHotkey by Shambles that brings up the same points you have regarding FileOpen.
Regards,
burque505
p.s. For some reason the fact I can't find that script again is driving me nuts.
Re: Lost script: Windows CMD shell in Gui control
Was it actually a cmd window or just a Gui that looked like a cmd window where you could type ahk stuff? If the latter, it reminds me of ACConsole by titan now at https://github.com/shajul/Autohotkey/bl ... onsole.ahk and a stripped down version here https://autohotkey.com/board/topic/2643 ... s-concept/ (the idea is to add labels which can do stuff, which could include simply running dos cmds and updating the Edit control with the results.
Or perhaps libcon / ahkconsole - https://github.com/ahkscript/awesome-Au ... y/#console
Or perhaps libcon / ahkconsole - https://github.com/ahkscript/awesome-Au ... y/#console
Re: Lost script: Windows CMD shell in Gui control Topic is solved
Thanks for the tips!
Here's my first shot, uses COM.
It is possible to break it with illegal commands, but if you're careful you can use it. What I'm thinking of next is adding an array with acceptable commands, and checking
the command entry against it. More on that later...
So why the "Change_Folder" and "Start_Folder" buttons?
It uses a "Wscript.Shell" object. You can't just change directories from the command line.
You have to use "objShell.CurrentDirectory := [some directory]. Thus a FileSelectFolder dialog
accessed by the button.
In the meantime, please break, mangle and report.
burque505
Here's my first shot, uses COM.
It is possible to break it with illegal commands, but if you're careful you can use it. What I'm thinking of next is adding an array with acceptable commands, and checking
the command entry against it. More on that later...
So why the "Change_Folder" and "Start_Folder" buttons?
It uses a "Wscript.Shell" object. You can't just change directories from the command line.
You have to use "objShell.CurrentDirectory := [some directory]. Thus a FileSelectFolder dialog
accessed by the button.
In the meantime, please break, mangle and report.
Spoiler
The obligatory proof of the pudding:
Regards,burque505
Re: Lost script: Windows CMD shell in Gui control
Is there a way to auto execute a command when opening the script
Who is online
Users browsing this forum: inseption86, marypoppins_1, peter_ahk and 170 guests