Lost script: Windows CMD shell in Gui control Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
burque505
Posts: 1736
Joined: 22 Jan 2017, 19:37

Lost script: Windows CMD shell in Gui control

24 Apr 2018, 15:12

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
User avatar
Masonjar13
Posts: 1555
Joined: 20 Jul 2014, 10:16
Location: Не Россия
Contact:

Re: Lost script: Windows CMD shell in Gui control

24 Apr 2018, 15:21

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.
OS: Windows 10 Pro | Editor: Notepad++
My Personal Function Library | Old Build - New Build
burque505
Posts: 1736
Joined: 22 Jan 2017, 19:37

Re: Lost script: Windows CMD shell in Gui control

25 Apr 2018, 08:17

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.
Guest

Re: Lost script: Windows CMD shell in Gui control

25 Apr 2018, 16:03

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
burque505
Posts: 1736
Joined: 22 Jan 2017, 19:37

Re: Lost script: Windows CMD shell in Gui control  Topic is solved

26 Apr 2018, 18:08

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.
Spoiler
The obligatory proof of the pudding:
RespecDos.gif
RespecDos.gif (159.59 KiB) Viewed 1207 times
Regards,
burque505
idk
Posts: 1
Joined: 01 May 2022, 13:17

Re: Lost script: Windows CMD shell in Gui control

01 May 2022, 13:21

Is there a way to auto execute a command when opening the script

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: wilkster and 323 guests