AutoHotkey Community

It is currently May 26th, 2012, 11:32 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 164 posts ]  Go to page Previous  1 ... 7, 8, 9, 10, 11  Next
Author Message
 Post subject:
PostPosted: November 8th, 2009, 4:20 am 
Offline

Joined: March 24th, 2009, 2:25 pm
Posts: 22
Is it possible to run multiple commands in a pipe with cmdret.dll?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 19th, 2009, 1:40 am 
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


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: November 20th, 2009, 4:50 am 
Offline

Joined: March 24th, 2009, 2:25 pm
Posts: 22
Yes, but without using cmd


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 19th, 2009, 8:33 am 
Offline
User avatar

Joined: December 29th, 2004, 1:28 pm
Posts: 2543
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")


Report this post
Top
 Profile  
Reply with quote  
 Post subject: I do not under stand
PostPosted: December 20th, 2009, 6:55 pm 
Offline

Joined: March 17th, 2007, 3:45 pm
Posts: 25
But
Code:
CMD := "cmd /c dir c: /s"

will not work
:?:


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Problems with cmdret
PostPosted: January 15th, 2010, 2:56 pm 
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...


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: January 18th, 2010, 4:27 pm 
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...


Report this post
Top
  
Reply with quote  
 Post subject: Re: I do not under stand
PostPosted: January 31st, 2010, 6:19 am 
Offline
User avatar

Joined: December 29th, 2004, 1:28 pm
Posts: 2543
luvan wrote:
But
Code:
CMD := "cmd /c dir c: /s"

will not work
:?:

Which operating system are you using?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 3rd, 2010, 11:58 am 
Offline

Joined: March 3rd, 2010, 11:03 am
Posts: 1
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!


Report this post
Top
 Profile  
Reply with quote  
PostPosted: December 3rd, 2010, 12:00 pm 
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.


Report this post
Top
  
Reply with quote  
PostPosted: December 4th, 2010, 8:51 pm 
Offline
User avatar

Joined: December 29th, 2004, 1:28 pm
Posts: 2543
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.


Report this post
Top
 Profile  
Reply with quote  
PostPosted: December 6th, 2010, 3:46 am 
Offline
User avatar

Joined: December 29th, 2004, 1:28 pm
Posts: 2543
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.


Report this post
Top
 Profile  
Reply with quote  
PostPosted: December 8th, 2010, 1:30 pm 
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!!


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: December 28th, 2010, 9:36 am 
Offline

Joined: October 31st, 2010, 3:02 am
Posts: 87
The tool is really great! But do not support ahk unicode version rightnow, what a pity! :?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 3rd, 2011, 2:53 am 
Offline
User avatar

Joined: December 29th, 2004, 1:28 pm
Posts: 2543
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


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 164 posts ]  Go to page Previous  1 ... 7, 8, 9, 10, 11  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: Google Feedfetcher and 2 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group