AutoHotkey Community

It is currently May 25th, 2012, 3:03 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 104 posts ]  Go to page Previous  1, 2, 3, 4, 5 ... 7  Next
Author Message
 Post subject:
PostPosted: April 28th, 2007, 8:25 pm 
Offline

Joined: May 24th, 2006, 2:49 pm
Posts: 4511
Location: Belgrade
Quote:
However, due to an apparent lack of interest in CMDret, although it is still being developed, I have decided not to spend the time posting any updates for it.

Argh, don't be ridiculous. When lack of interest had anything to do with the quolity of the thing? This is great function and you should update it.

Quote:
CMDret was originally provided as a function to allow people at the forum an opportunity to participate in development in hopes that the result would inspire Chris to add this functionality (possibly with similar syntax and functionality of the version(s) posted) as a built-in command/function in AutoHotkey.

I don't see why function can't be equaly powerful.

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 29th, 2007, 12:16 am 
Offline

Joined: February 12th, 2007, 7:54 am
Posts: 2462
corrupt wrote:
Sean, It looks like your version is coming along nicely :) . I would have preferred if it the functionality was produced as a single function instead of several functions that rely on each other but some people tend to prefer things broken apart in small pieces. It's all good :) .

Thanks and I know what you mean. Personally, I also prefer having it in a single procedural entity and found it myself easier to follow. Contrary to my expectation, however, looks like many users feel it complicated in that way, so I tended to write in a function form and expose only necessary steps.

Quote:
One of the main reasons for CMDret creating a hidden console window was for compatibility for a few specific applications and for creating workarounds for 16 bit applications (unreleased versions). This difference can be made in either version by modifying one line of code though.

I see. I thought you might have a reason about that.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 27th, 2007, 1:22 am 
regarding StdoutToVar.ahk:

First, Where does this actually access cmd.exe?

Secondly, would this be adaptable to work with telnet.exe?

I am trying to get a responsive from of telnet (i.e. to login and run certain commands dependant on what information is currently in the telnet window, hidden or not)

I have tried to use this to access telnet but it does not return anything at all.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: September 27th, 2007, 2:19 am 
Offline

Joined: February 12th, 2007, 7:54 am
Posts: 2462
Erittaf wrote:
First, Where does this actually access cmd.exe?

When it calls CreateProcess(), but without creating the console window, so you may not notice it.

Quote:
Secondly, would this be adaptable to work with telnet.exe?

telnet.exe is an interactive app, i.e., needs an interaction with the user, so I don't think this script is usable with it. The same with netsh.exe.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 22nd, 2007, 9:02 pm 
What does sWork do? I see it is empty in both examples. I'm just curious what it does. Thanks for creating such a great script for us other people on the forum.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: November 23rd, 2007, 12:05 am 
Offline

Joined: February 12th, 2007, 7:54 am
Posts: 2462
SecurityAnalysis wrote:
What does sWork do?

It'll set the Current/Working directory, which corresponds to AHK's A_WorkingDir.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 23rd, 2007, 1:01 am 
Thanks


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: November 24th, 2007, 1:40 pm 
Offline

Joined: February 12th, 2007, 7:54 am
Posts: 2462
At last I updated StdoutToVar.ahk and StdoutWithCOM.ahk and combined into one.
They aren't tested thoroughly as I uses console apps less and less thanks to AHK, so please post here if find a bug. Thanks.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 28th, 2007, 5:27 am 
Offline

Joined: February 12th, 2007, 7:54 am
Posts: 2462
The script is simplified further. Now, I think/hope it's really easy to use.
Code:
sCmd := "ipconfig /all"
;bStream := ""
;sDir := ""
;sInput := ""

MsgBox % StdoutToVar_CreateProcess(sCmd, bStream, sDir, sInput)   ; StdoutToVar_CreateProcessCOM(sCmd, bStream, sDir, sInput)


Last edited by Sean on July 13th, 2008, 3:36 am, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 1st, 2007, 7:04 pm 
Offline

Joined: July 3rd, 2004, 1:03 pm
Posts: 121
Both this and CMDret are great. Hats off to both authors.

As far as the interest issues go, I think that is due to needing more examples of how it works. If you focus just on StdoutToVar.ahk and CMDret , than possibly more novice or casual users may get lost with how you created the script, DllCall talk, etc...

From a user perspective, maybe when people see more of the possibilities and how to use it that it would generate more interest.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 2nd, 2007, 1:28 am 
Offline

Joined: February 12th, 2007, 7:54 am
Posts: 2462
AHKnow wrote:
From a user perspective, maybe when people see more of the possibilities and how to use it that it would generate more interest.

I thought there was little to tell more about it, quite self-evident. I may be wrong. Here are a few more examples.

Code:
; StdoutToVar_CreateProcess(sCmd, bStream = False, sDir = "", sInput = "") ; The function definition

Code:
MsgBox % sOutput := StdoutToVar_CreateProcess("ipconfig.exe /all")

Code:
MsgBox % sOutput := StdoutToVar_CreateProcess("ping.exe www.autohotkey.com", True) ; with Streaming On

Code:
MsgBox % sOutput := StdoutToVar_CreateProcess("cmd.exe /c dir /a /o", "", A_WinDir) ; with Working Directory

Code:
MsgBox % sOutput := StdoutToVar_CreateProcess("sort.exe", "", "", "abc`r`nefg`r`nhijk`r`n0123`r`nghjki`r`ndflgkhu`r`n") ; with Stdin string


Last edited by Sean on July 13th, 2008, 3:44 am, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 7th, 2007, 10:08 pm 
Hi,

is it possible to use this function with tools like telnet? just to get alle the text telnets writing.
A script like this:
- starting telnet
- getting text by your function (how could this work?)
- sending command to telnet
- getting text again

and so on. I hope its no big deal?


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: December 8th, 2007, 12:27 am 
Offline

Joined: February 12th, 2007, 7:54 am
Posts: 2462
User2001 wrote:
is it possible to use this function with tools like telnet?

There already is the same question a few posts above.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 8th, 2007, 10:29 am 
Yes, i already noticed that. But you said its not possible, because its need interaction with the user. But wheres the problem with interaction? I just get a problem getting the telnet text again and again.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: December 8th, 2007, 12:21 pm 
Offline

Joined: February 12th, 2007, 7:54 am
Posts: 2462
User2001 wrote:
I just get a problem getting the telnet text again and again.

In this case you may use it. But, the problem is: how you're gonna terminate the telnet.exe gracefully? There is no way except using AHK's built-in function "Process, Close" or directly TerminateProcess API (which is easier one in this case). They (actually it) are not graceful exit, you may lose data.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 104 posts ]  Go to page Previous  1, 2, 3, 4, 5 ... 7  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], Google Feedfetcher, oldbrother and 14 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