| View previous topic :: View next topic |
| Author |
Message |
RandomHeart
Joined: 24 Mar 2009 Posts: 20
|
Posted: Sun Nov 08, 2009 3:20 am Post subject: |
|
|
| Is it possible to run multiple commands in a pipe with cmdret.dll? |
|
| Back to top |
|
 |
widow Guest
|
Posted: Thu Nov 19, 2009 12:40 am Post subject: |
|
|
| 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: 20
|
Posted: Fri Nov 20, 2009 3:50 am Post subject: |
|
|
| Yes, but without using cmd |
|
| Back to top |
|
 |
corrupt
Joined: 29 Dec 2004 Posts: 2485
|
Posted: Sat Dec 19, 2009 7:33 am Post subject: |
|
|
| 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 |
|
 |
luvan
Joined: 17 Mar 2007 Posts: 25
|
Posted: Sun Dec 20, 2009 5:55 pm Post subject: I do not under stand |
|
|
But
| Code: | | CMD := "cmd /c dir c: /s" |
will not work
 |
|
| Back to top |
|
 |
segalion Guest
|
Posted: Fri Jan 15, 2010 1:56 pm Post subject: Problems with cmdret |
|
|
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
|
Posted: Mon Jan 18, 2010 3:27 pm Post subject: |
|
|
| 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: 2485
|
Posted: Sun Jan 31, 2010 5:19 am Post subject: Re: I do not under stand |
|
|
| luvan wrote: | But
| Code: | | CMD := "cmd /c dir c: /s" |
will not work
 |
Which operating system are you using? |
|
| Back to top |
|
 |
autoh0tkey.com-user
Joined: 03 Mar 2010 Posts: 1
|
Posted: Wed Mar 03, 2010 10:58 am Post subject: |
|
|
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 |
|
 |
term181170 Guest
|
Posted: Fri Dec 03, 2010 11:00 am Post subject: Using cmdret.dll from c++ |
|
|
| I'm trying to use is at cmdret.dll RunReturn from a dll written in C + +. I'm using the load at run time and am not able to get the output of the command and the function returns 1016. I want to know the exact type of the parameters of each of the functions or if there cmdret.lib cmdret.dll to link to my project. Thank you very much. |
|
| Back to top |
|
 |
corrupt
Joined: 29 Dec 2004 Posts: 2485
|
Posted: Sat Dec 04, 2010 7:51 pm Post subject: Re: Using cmdret.dll from c++ |
|
|
| term181170 wrote: | | I'm trying to use is at cmdret.dll RunReturn from a dll written in C + +. I'm using the load at run time and am not able to get the output of the command and the function returns 1016. I want to know the exact type of the parameters of each of the functions or if there cmdret.lib cmdret.dll to link to my project. Thank you very much. | I'll see if I can locate the source code a bit later today (BCX, C sources. It's on a PC that I haven't started up in a couple months) and let you know and/or provide the source code for download. Note: the current version uses the stdcall calling convention. |
|
| Back to top |
|
 |
corrupt
Joined: 29 Dec 2004 Posts: 2485
|
Posted: Mon Dec 06, 2010 2:46 am Post subject: Re: Using cmdret.dll from c++ |
|
|
| corrupt wrote: | | term181170 wrote: | | I'm trying to use is at cmdret.dll RunReturn from a dll written in C + +. I'm using the load at run time and am not able to get the output of the command and the function returns 1016. I want to know the exact type of the parameters of each of the functions or if there cmdret.lib cmdret.dll to link to my project. Thank you very much. | I'll see if I can locate the source code a bit later today (BCX, C sources. It's on a PC that I haven't started up in a couple months) and let you know and/or provide the source code for download. Note: the current version uses the stdcall calling convention. | I haven't located the current code yet but the previous version used the following: C_EXPORT long __stdcall RunReturn (char *CMDin, char *CMDout)
The output is the number of characters returned + 1 or 0 if the process could not be created. |
|
| Back to top |
|
 |
Guest
|
Posted: Wed Dec 08, 2010 12:30 pm Post subject: Re: Using cmdret.dll from c++ |
|
|
| corrupt wrote: | | corrupt wrote: | | term181170 wrote: | | I'm trying to use is at cmdret.dll RunReturn from a dll written in C + +. I'm using the load at run time and am not able to get the output of the command and the function returns 1016. I want to know the exact type of the parameters of each of the functions or if there cmdret.lib cmdret.dll to link to my project. Thank you very much. | I'll see if I can locate the source code a bit later today (BCX, C sources. It's on a PC that I haven't started up in a couple months) and let you know and/or provide the source code for download. Note: the current version uses the stdcall calling convention. | I haven't located the current code yet but the previous version used the following: C_EXPORT long __stdcall RunReturn (char *CMDin, char *CMDout)
The output is the number of characters returned + 1 or 0 if the process could not be created. |
Thank you very much. Now work!! |
|
| Back to top |
|
 |
aSEioT
Joined: 31 Oct 2010 Posts: 85
|
Posted: Tue Dec 28, 2010 8:36 am Post subject: |
|
|
The tool is really great! But do not support ahk unicode version rightnow, what a pity!  |
|
| Back to top |
|
 |
corrupt
Joined: 29 Dec 2004 Posts: 2485
|
Posted: Thu Mar 03, 2011 1:53 am Post subject: |
|
|
| aSEioT wrote: | The tool is really great! But do not support ahk unicode version rightnow, what a pity!  | I'm not currently using AhkL but will look into it. Thanks |
|
| Back to top |
|
 |
|