hani-dev Posted May 27, 2017 Author Posted May 27, 2017 (edited) @jos it's stuck on ( please enter website) when i try to use keyboard to enter any think it does not writing any think i test it on 2 machines the same issue it work fine inside SciTE Edited May 27, 2017 by hani-dev
Gianni Posted May 27, 2017 Posted May 27, 2017 Yesterday I tried the @Jos's script from post #13 on win10 x64 and it worked, today I tried it on win7 x64 and is not working... Chimp small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....
Developers Jos Posted May 27, 2017 Developers Posted May 27, 2017 Try compiling it as x64 and see what it does. I have no means to test that. Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
Gianni Posted May 27, 2017 Posted May 27, 2017 compiled as x64, same result. All what you type does not appear .... then, typing ctrl-c the script ends, the dos prompt reappears, and all what you had typed appears next to the dos prompt... Chimp small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....
hani-dev Posted May 27, 2017 Author Posted May 27, 2017 3 minutes ago, Chimp said: compiled as x64, same result. All what you type does not appear .... then, typing ctrl-c the script ends, the dos prompt reappears, and all what you had typed appears next to the dos prompt... yes @Jos thats the problem !! how we can solve it
Developers Jos Posted May 27, 2017 Developers Posted May 27, 2017 So you say that is working fine? if so what is there to solve exactly? SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
hani-dev Posted May 27, 2017 Author Posted May 27, 2017 (edited) 29 minutes ago, Chimp said: Yesterday I tried the @Jos's script from post #13 on win10 x64 and it worked, today I tried it on win7 x64 and is not working... im using windows 7 x64 and it's not working i never test it on windows 10 Edited May 27, 2017 by hani-dev
hani-dev Posted May 27, 2017 Author Posted May 27, 2017 @jos no it's not working ill record video for u
TurionAltec Posted May 27, 2017 Posted May 27, 2017 (edited) a) I don't know why @COMSPEC is being called for a command (ping) that's external to cmd.exe Run("Ping www.google.com", "", @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD) should work. Second ConsoleRead() doesn't work as expected from compiled console applications. If you piped it through "more" it would work. You used to be able to open the file "con" as raw, but that stopped working. Check out this UDF: I also found this snippit that opens console as raw using API: ;https://www.autoitscript.com/forum/topic/107951-help-with-_winapi_createfile-function-and-raw-mode/?do=findComment&comment=761172 #AutoIt3Wrapper_Change2CUI=y #include <WinAPI.au3> $sResponse = _ConsoleInput("Please input some text: ") ConsoleWrite("You Entered: " & $sResponse & @CRLF) Func _ConsoleInput($sPrompt) If Not @Compiled Then Return SetError(1, 0, 0) ; Not compiled ConsoleWrite($sPrompt) Local $tBuffer = DllStructCreate("char"), $nRead, $sRet = "" Local $hFile = _WinAPI_CreateFile("CON", 2, 2) While 1 _WinAPI_ReadFile($hFile, DllStructGetPtr($tBuffer), 1, $nRead) If DllStructGetData($tBuffer, 1) = @CR Then ExitLoop If $nRead > 0 Then $sRet &= DllStructGetData($tBuffer, 1) WEnd _WinAPI_CloseHandle($hFile) Return $sRet EndFunc Edited May 27, 2017 by TurionAltec
Gianni Posted May 27, 2017 Posted May 27, 2017 6 minutes ago, hani-dev said: im using windows 7 x64 and it's now working ...... 5 minutes ago, hani-dev said: @jos no it's not working ...... ..... ..... funny Chimp small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....
Developers Jos Posted May 27, 2017 Developers Posted May 27, 2017 I don't need a video. .. Just got confused which easily happens at my age. SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
hani-dev Posted May 27, 2017 Author Posted May 27, 2017 2 minutes ago, Chimp said: ..... ..... funny by mistake i edit the comment the final result is not working and am still have the issue
hani-dev Posted May 27, 2017 Author Posted May 27, 2017 (edited) ;https://www.autoitscript.com/forum/topic/107951-help-with-_winapi_createfile-function-and-raw-mode/?do=findComment&comment=761172 #AutoIt3Wrapper_Change2CUI=y #include <WinAPI.au3> $sResponse = _ConsoleInput("Please input some text: ") ConsoleWrite("You Entered: " & $sResponse & @CRLF) Func _ConsoleInput($sPrompt) If Not @Compiled Then Return SetError(1, 0, 0) ; Not compiled ConsoleWrite($sPrompt) Local $tBuffer = DllStructCreate("char"), $nRead, $sRet = "" Local $hFile = _WinAPI_CreateFile("CON", 2, 2) While 1 _WinAPI_ReadFile($hFile, DllStructGetPtr($tBuffer), 1, $nRead) If DllStructGetData($tBuffer, 1) = @CR Then ExitLoop If $nRead > 0 Then $sRet &= DllStructGetData($tBuffer, 1) WEnd _WinAPI_CloseHandle($hFile) Return $sRet EndFunc @jos , @Chimp , @TurionAltec how i can edit this script to take what i input in _consoleinput ( www.google.com) and excute ping on it @Subz can u help me ? Edited May 27, 2017 by hani-dev
TurionAltec Posted May 27, 2017 Posted May 27, 2017 #AutoIt3Wrapper_Change2CUI=y #include <WinAPI.au3> #include <AutoItConstants.au3> $sResponse = _ConsoleInput("Please enter website:") ConsoleWrite("pinging:" & $sResponse&@CRLF) $DOS = Run("Ping " & $sResponse, "", @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD) While ProcessExists($DOS) $Message = StdoutRead($DOS) ConsoleWrite($Message) WEnd $Message = StdoutRead($DOS) If $Message <> "" Then ConsoleWrite($Message) ;https://www.autoitscript.com/forum/topic/107951-help-with-_winapi_createfile-function-and-raw-mode/?do=findComment&comment=761172 Func _ConsoleInput($sPrompt) If Not @Compiled Then Return SetError(1, 0, 0) ; Not compiled ConsoleWrite($sPrompt) Local $tBuffer = DllStructCreate("char"), $nRead, $sRet = "" Local $hFile = _WinAPI_CreateFile("CON", 2, 2) While 1 _WinAPI_ReadFile($hFile, DllStructGetPtr($tBuffer), 1, $nRead) If DllStructGetData($tBuffer, 1) = @CR Then ExitLoop If $nRead > 0 Then $sRet &= DllStructGetData($tBuffer, 1) WEnd _WinAPI_CloseHandle($hFile) Return $sRet EndFunc hani-dev 1
hani-dev Posted May 27, 2017 Author Posted May 27, 2017 @TurionAltec big boss thanx u very much developer it's working from cmd <3
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now