Jump to content

Send {ENTER} on compiled script inside CYGWIN


Recommended Posts

Greetings,

If you create a compiled script in C:\cygwin\bin\teste.exe, you can execute/call a teste.exe inside cygwin, but I cant's simulate the {ENTER}.

Do you know any way to solve this?

Compile and put a teste.exe in C:\cygwin\bin\

in cygwin, type teste

MY_MACHINE+MY_USER@MY_MACHINE/
$ teste ls
ls -l
ls -l
ls -l
ls -l==FIM==

MY_MACHINE+MY_USER@MY_MACHINE/
$

Best regards.

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Outfile=teste.exe
#AutoIt3Wrapper_Compression=4
#AutoIt3Wrapper_UseUpx=y
#AutoIt3Wrapper_Change2CUI=y
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
;~ #RequireAdmin
Global Const $LF = @CRLF
Global $TEMP

Global $PID = WinGetProcess("[CLASS:mintty]")
Global $CMD = "ls -l"

If $CmdLine[0] Then
    ConsoleWrite($CMD & @CR)
    Sleep(500)

    ConsoleWrite($CMD & @LF)
    Sleep(500)

    ConsoleWrite($CMD & @CRLF)
    Sleep(500)

    ConsoleWrite($CMD)
    Send("{ENTER}")
    Sleep(500)

    ConsoleWrite($CMD)
    ControlSend($PID, "", "", "{ENTER}")
    Sleep(500)

    ConsoleWrite("==FIM==" & Chr(0x0D) & @CRLF)
EndIf

 

Edited by Luigi

Visit my repository

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...