TheAutomator

Retro fullscreen console with custom programming language!

9 posts in this topic

#1 ·  Posted (edited)

A fullscreen console with custom commands!

Example.thumb.gif.4b4ac6863696ff393a9caf

Introduction:

Hi everyone! :)

This funny project started as a question in the help section:

https://www.autoitscript.com/forum/topic/174404-edit-detect-key-before-updating-content/

I'd like to share this script with everyone that is interested. :)

 

Why would I want it?

  • You like the old style fullscreen console (like in the old day's),
  • You can add custom commands,
  • You can customize the font a lot more compared to cmd.exe,
  • You can share ideas or add tweaks to the script.

 

What's next?

I'm planning to add my own programming language to it!

Its going to be implemented with an ActiveX COM dll.

The syntax is going to be a bit like Lua I guess, any ideas are welcome!

 

Todo:

  • Add sounds.
  • Make an icon / logo.
  • Design a better grammar ( Backus-Naur-vormhttps://nl.wikipedia.org/wiki/Backus-Naur-vorm ).
  • Make test "Console-Scripts" for it.
  • Add a file type for script files ( like batch scripts ).
  • Clean up and modify Console.Au3 content.
  • Add an option to have to type a login password (maybe).
  • Call neo B)

 

Thanks to:

  • xxaviarxx: debugging, some ideas.
  • jguinch: debugging, adding a bunch of tweaks and ideas.
  • kylomas: debugging, new ideas.

 

Edits and updates:

  • Added tab key
  • Main edit has focus now on startup
  • Made a pdf that explains the upcoming programming language (need feedback about it!)

 

Until the dll is ready you can have fun with what I already have, hope you like it!

UDF can be downloaded from the attachments.

Regards ;)

 

[The programming language part is been postponed due to lack of interest]

 

TheAutomator

 

Console.au3

ConsoleScript.pdf

Edited by TheAutomator
2 people like this

Share this post


Link to post
Share on other sites



Need to make sure the window is active as soon as you run the script otherwise your users will have to click a full screen console. At the preset time you have to click it.

Share this post


Link to post
Share on other sites

Need to make sure the window is active as soon as you run the script otherwise your users will have to click a full screen console. At the preset time you have to click it.

Seems like $WS_TABSTOP prevents direct user input...

I updated the script :)

Thanks xxaviarxx !

Share this post


Link to post
Share on other sites
  • You can customize the font (unlike cmd.exe)

:think: I don't belive it...

http://www.wikihow.com/Customize-the-Font-in-Windows-Command-Prompt

TD ;)


AutoIt.4.Life Clubrooms - Life is like a Donut (secret key)

Spoiler

My contributions to the AutoIt Community

Some messages & Apologizes:

If I hurt you, Please accept my apologies, I never (regardless of the situation) mean to hurt anybody!!!

Also, I am very busy with my project so I will appear in the last row of the online list, if you want to contact me: Email@TheDcoder.xyz

Or you can have a nice chat with me in freenode, I use the same nick on freenode too!

3fHNZJ.gif

PLEASE JOIN ##AutoIt AND HELP THE IRC AUTOIT COMMUNITY!

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

TheDcoder,

Cmd.exe has 1 build in raster font and 2 optional ones you can choose of.

if you want to add a font you have to change the registry and you have to be lucky enough to find a raster font that will be accepted by cmd prompt..

(and even that doesn't work on my computer for some reason)

try to add a new font like: westminster.ttf to it and post a screenshot ;)

but ok, technically I should say that you can customize the fonts 'a lot more' then you can with cmd, so I'm gonna change that in my description.

Edited by TheAutomator

Share this post


Link to post
Share on other sites

@TheAutomator Oh, silly me :P


AutoIt.4.Life Clubrooms - Life is like a Donut (secret key)

Spoiler

My contributions to the AutoIt Community

Some messages & Apologizes:

If I hurt you, Please accept my apologies, I never (regardless of the situation) mean to hurt anybody!!!

Also, I am very busy with my project so I will appear in the last row of the online list, if you want to contact me: Email@TheDcoder.xyz

Or you can have a nice chat with me in freenode, I use the same nick on freenode too!

3fHNZJ.gif

PLEASE JOIN ##AutoIt AND HELP THE IRC AUTOIT COMMUNITY!

Share this post


Link to post
Share on other sites

#8 ·  Posted

I just gave you some appreciation on other thread. Thanks bro, I am using it.

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

its nice but please be aware that microsoft made powershell on every windows V7 and further available. 

type ISE in your startmenu / search  box and see an integrated IDE something between IDE/debugwindow/scripting at the same time

this shows the concept for excel.application

https://social.technet.microsoft.com/Forums/scriptcenter/en-US/33dbc1c4-40ee-4ef8-b25b-f29440ab3194/using-com-objects-excel-from-powershell?forum=ITCG

suggestion would be to incorporate javascript CHAKRA then you do not have to write a new grammar

 

 

 

Edited by junkew
nice see now its a little older thread

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now

  • Similar Content

    • hcI
      By hcI
      Hello I would like to know if there is a way to return a sentence in cmd when I launch from it (because I add arguments).
      For example, diskpart.exe which help to manage the key and hdd connected, when you launch it with the parameter "/f" the app return a sentence saying that it don't recognize the parameter "/f" and it return the sentence in the cmd where i started the application, not a new one.
      That's what I want to do but I couldn't find anything that would solve my problem on internet and on AutoIt like ConsoleWrite / ConsoleWriteError (don't work).
       
      Thanks
    • Duck
      By Duck
      I'm attempting to capture the output from the command line tool PSEXEC. I'm using AutoIT to run an instance of PSEXEC against a remote PC to audit Local Admins in my environment using net.exe (C:\Windows\System32> net localgroup administrators). However the usual trick I use to capture command line output does not appear to work well with PSEXEC, as the bottom portion of the output is missing from the return. Any ideas or recommendations are greatly appreciated.  
       
      Here is what I'm working with: 
      ;This script will read from a list of hosts and report who has local admin privileges on the machine #RequireAdmin Global $fileName = @ScriptDir & '\test.txt' ;hostlist, one host per line readHostList() ;Read list of hosts Func readHostList() Local $file = FileOpen($fileName, 0) While 1 $line = FileReadLine($file) If @error = -1 Then ExitLoop ConsoleWrite($line & @CRLF) ;MsgBox(0,0,$line) getLocalAdmins($line) WEnd FileClose($file) EndFunc ;run PSEXEC to list local admins Func getLocalAdmins($remotePC) Local $testFile = @ScriptDir &'\test234.txt' FileOpen($testFile, 1) Local $psexec = 'psexec \\' & $remotePC & ' net localgroup administrators' FileWriteLine($testFile, _RunCmd($psexec) ) FileClose($testFile) EndFunc ;Used to return CLI output Func _RunCmd($sCommand) Local $nPid = Run(@Comspec & " /c" & $sCommand, @SystemDir, @SW_Hide, 8), $sRet = "" If @Error then Return "ERROR:" & @ERROR ProcessWait($nPid) While 1 $sRet &= StdoutRead($nPID) If @error Or (Not ProcessExists ($nPid)) Then ExitLoop WEnd Return $sRet EndFunc  
      ## If i manually run the command on the remote PC via PSEXEC I will get the following output: 
      PsExec v2.11 - Execute processes remotely
      Copyright (C) 2001-2014 Mark Russinovich
      Sysinternals - www.sysinternals.com
      Starting net on PCNAME... on PCNAME...
      net exited on PCNAME with error code 0.
      -------------------------------------------------------------------------------
      admin
      Administrator
      Alias name     administrators
      Domain\Domain Admins
      Comment        Administrators have complete and unrestricted access to the computer/domain
      Members
      The command completed successfully.
       
      ## The returned output from running the above script is as follows:
      PsExec v2.11 - Execute processes remotely
      Copyright (C) 2001-2014 Mark Russinovich
      Sysinternals - www.sysinternals.com
      Alias name     administrators
      Connecting to PCNAME...
      Starting PSEXESVC service on PCNAME...
      Connecting with PsExec service on PCName...
      Starting net on PCNAME..
      net exited on PCNAME with error code 0.
       
      **Note to test this script PSEXEC must be in the system dir or the path in the script changed 
      PSEXEC tool: https://docs.microsoft.com/en-us/sysinternals/downloads/psexec
    • ur
      By ur
      I am running the tomcat batch file through autoit   and need to wait until the below line I get in console output.

      But when I am trying to read the console output using the ProcessEx UDF, I am getting only the partial output.
      So, can you please suggest how to handle this.
    • luckyluke
      By luckyluke
      Hello,
      Im trying to read the output from CMD using Dllcall, here is my code:
      #include <WinAPI.au3> #include <array.au3> Global Const $STD_OUTPUT_HANDLE = -11 Global Const $_CONSOLE_SCREEN_BUFFER_INFO = _ "struct;int dwSizeX;" & _ "short dwSizeY;" & _ "short dwCursorPositionX;" & _ "short dwCursorPositionY;" & _ "short wAttributes;" & _ "short Left;" & _ "short Top;" & _ "short Right;" & _ "short Bottom;" & _ "short dwMaximumWindowSizeX;" & _ "short dwMaximumWindowSizeY;endstruct" $pCmd = Run( "cmd.exe" ) Sleep(1000) $hCmd = WinGetHandle("") ConsoleWrite('handle:' & $hCmd & @CRLF) $aRet = DllCall("kernel32.dll", "int", "AttachConsole", "dword", $pCmd) ;_ArrayDisplay($aRet) If $aRet[0] <> 0 Then $vHandle_data='' $vHandle='' $vHandle_data = DllStructCreate($_CONSOLE_SCREEN_BUFFER_INFO) ; Screen Buffer structure $aRet1 = DllCall("kernel32.dll", "hwnd", "GetStdHandle", "dword", $STD_OUTPUT_HANDLE) if not @error Then $vHandle = $aRet1[0] $aRet = DllCall("kernel32.dll", "int", "GetConsoleScreenBufferInfo", "hwnd", $vHandle, _ "ptr", $vHandle_data) MsgBox(0, '1',DllStructGetData($vHandle_data, 'dwSizeX') & _WinAPI_GetLastErrorMessage()) EndIf It did not work, i got the message 'The handle is invalid'. Please help?
      Thank you in advance!
    • mihaijulien
      By mihaijulien
      Hello,
      I compiled a script I made that takes a command line parameter (the version of a .msi installer) when launched. The script was compiled with the /console option. The script (.au3) works fine but the executable returns  the following error:  
      Error: array variable has incorrect number of subscripts or subscript dimension range exceeded