AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CMDret - return output from console progs [DLL version]
Goto page Previous  1, 2, 3, 4, 5, 6, 7, 8, 9, 10
 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Utilities & Resources
View previous topic :: View next topic  
Author Message
RandomHeart



Joined: 24 Mar 2009
Posts: 11

PostPosted: Sun Nov 08, 2009 4:20 am    Post subject: Reply with quote

Is it possible to run multiple commands in a pipe with cmdret.dll?
Back to top
View user's profile Send private message
widow
Guest





PostPosted: Thu Nov 19, 2009 1:40 am    Post subject: Reply with quote

RandomHeart wrote:
Is it possible to run multiple commands in a pipe with cmdret.dll?


You mean like this?

Code:
cmd /k netstat -ano|find /i "connected" && IF ERRORLEVEL==1 echo a>.\log.txt
Back to top
RandomHeart



Joined: 24 Mar 2009
Posts: 11

PostPosted: Fri Nov 20, 2009 4:50 am    Post subject: Reply with quote

Yes, but without using cmd
Back to top
View user's profile Send private message
corrupt



Joined: 29 Dec 2004
Posts: 2446

PostPosted: Sat Dec 19, 2009 8:33 am    Post subject: Reply with quote

Anonymous wrote:
why this doesnt work

Code:
; CMDret DLL version 3.1 (or greater) required

Run, Notepad,,, notepid
WinWait, ahk_pid %notepid%
WinWaitActive, ahk_pid %notepid%

CMD := "dir"
ControlGet, OutputWindow, Hwnd,, Edit1, ahk_pid %notepid%
if OutputWindow <> 0
  StrOut := DllCall("cmdret.dll\RunInControl", "str", CMD, "Uint", OutputWindow, "str", "Edit", "int", "1")

It doesn't work because dir is not an executable file. You would need to load the command interpreter first.
Code:
; CMDret DLL version 3.1 (or greater) required

Run, Notepad,,, notepid
WinWait, ahk_pid %notepid%
WinWaitActive, ahk_pid %notepid%

CMD := "cmd /c dir c:"
ControlGet, OutputWindow, Hwnd,, Edit1, ahk_pid %notepid%
if OutputWindow <> 0
  StrOut := DllCall("cmdret.dll\RunInControl", "str", CMD, "Uint", OutputWindow, "str", "Edit", "int", "1")
Back to top
View user's profile Send private message Visit poster's website
luvan



Joined: 17 Mar 2007
Posts: 24

PostPosted: Sun Dec 20, 2009 6:55 pm    Post subject: I do not under stand Reply with quote

But
Code:
CMD := "cmd /c dir c: /s"

will not work
Question
Back to top
View user's profile Send private message
segalion
Guest





PostPosted: Fri Jan 15, 2010 2:56 pm    Post subject: Problems with cmdret Reply with quote

I was using CMDret (runreturn) example funtion succesfully until I have in problems with timing in some cases executing (I suppose) large commandline curl parameter.

Seems that if I use CMD direct comand, it returns in less than 2 seconds. And when I use the same CMDret function it takes more than 15 secs.

Is there any limit with size of parameter command?
Maybe a problem with directory locations? I was using allways the full path...
Back to top
segalion
Guest





PostPosted: Mon Jan 18, 2010 4:27 pm    Post subject: Reply with quote

Sorry by the previous post. Thats was an error with timers stuffs. The function work fine (as cmd.exe) as expected calling first than call the timers...
Back to top
corrupt



Joined: 29 Dec 2004
Posts: 2446

PostPosted: Sun Jan 31, 2010 6:19 am    Post subject: Re: I do not under stand Reply with quote

luvan wrote:
But
Code:
CMD := "cmd /c dir c: /s"

will not work
Question

Which operating system are you using?
Back to top
View user's profile Send private message Visit poster's website
autoh0tkey.com-user



Joined: 03 Mar 2010
Posts: 1

PostPosted: Wed Mar 03, 2010 11:58 am    Post subject: Reply with quote

Some command line programs require User Input. How can I do to insert it?

Like:


Code:
c:\prog\>server_login.exe
Enter your user name
John
Enter your password
x3343
Verifying ....



Thanks!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Utilities & Resources All times are GMT
Goto page Previous  1, 2, 3, 4, 5, 6, 7, 8, 9, 10
Page 10 of 10

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group