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 

StdoutToVar
Goto page Previous  1, 2, 3, 4  Next
 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
majkinetor



Joined: 24 May 2006
Posts: 3615
Location: Belgrade

PostPosted: Sat Apr 28, 2007 8:25 pm    Post subject: Reply with quote

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.
_________________
Back to top
View user's profile Send private message MSN Messenger
Sean



Joined: 12 Feb 2007
Posts: 1281

PostPosted: Sun Apr 29, 2007 12:16 am    Post subject: Reply with quote

corrupt wrote:
Sean, It looks like your version is coming along nicely Smile . 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 Smile .

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.
Back to top
View user's profile Send private message
Erittaf
Guest





PostPosted: Thu Sep 27, 2007 1:22 am    Post subject: Reply with quote

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.
Back to top
Sean



Joined: 12 Feb 2007
Posts: 1281

PostPosted: Thu Sep 27, 2007 2:19 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
SecurityAnalysis
Guest





PostPosted: Thu Nov 22, 2007 9:02 pm    Post subject: Reply with quote

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.
Back to top
Sean



Joined: 12 Feb 2007
Posts: 1281

PostPosted: Fri Nov 23, 2007 12:05 am    Post subject: Reply with quote

SecurityAnalysis wrote:
What does sWork do?

It'll set the Current/Working directory, which corresponds to AHK's A_WorkingDir.
Back to top
View user's profile Send private message
SecurityAnalysis
Guest





PostPosted: Fri Nov 23, 2007 1:01 am    Post subject: Reply with quote

Thanks
Back to top
Sean



Joined: 12 Feb 2007
Posts: 1281

PostPosted: Sat Nov 24, 2007 1:40 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Sean



Joined: 12 Feb 2007
Posts: 1281

PostPosted: Wed Nov 28, 2007 5:27 am    Post subject: Reply with quote

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 Sun Jul 13, 2008 3:36 am; edited 1 time in total
Back to top
View user's profile Send private message
AHKnow



Joined: 03 Jul 2004
Posts: 118

PostPosted: Sat Dec 01, 2007 7:04 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Sean



Joined: 12 Feb 2007
Posts: 1281

PostPosted: Sun Dec 02, 2007 1:28 am    Post subject: Reply with quote

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 Sun Jul 13, 2008 3:44 am; edited 1 time in total
Back to top
View user's profile Send private message
User2001
Guest





PostPosted: Fri Dec 07, 2007 10:08 pm    Post subject: Reply with quote

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?
Back to top
Sean



Joined: 12 Feb 2007
Posts: 1281

PostPosted: Sat Dec 08, 2007 12:27 am    Post subject: Reply with quote

User2001 wrote:
is it possible to use this function with tools like telnet?

There already is the same question a few posts above.
Back to top
View user's profile Send private message
User2001
Guest





PostPosted: Sat Dec 08, 2007 10:29 am    Post subject: Reply with quote

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.
Back to top
Sean



Joined: 12 Feb 2007
Posts: 1281

PostPosted: Sat Dec 08, 2007 12:21 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Goto page Previous  1, 2, 3, 4  Next
Page 2 of 4

 
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