Sign in to follow this  
Followers 0
Tagor

Get the output of a cmd command

10 posts in this topic

Is there a way to get the output of a CMD command? For example the output of "date".

Share this post


Link to post
Share on other sites

type

COMMAND > where you want the file ... eg "c:\test.txt" without the quotation marks


[u]Old Projects:[/u]A3MORGB2Hex[u]Old Functions:[/u]_TimeAdd/_TimeSub_AddComma_BubbleSort _RippleSort "He who does not understand your silence will probably not understand your words." - Elbert Hubbard.

Share this post


Link to post
Share on other sites

Thanks, but isn't it possible to read the information in a var. directly?

Share this post


Link to post
Share on other sites

Thanks, but isn't it possible to read the information in a var. directly?

<{POST_SNAPBACK}>

yes, but currently only with the 3.1.0++ version posted by JPM, as mentioned by dok_do ...

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

I tried but was unsuccesfull at getting it to read from the cmd and send it back out to another app that was supposed to be reading from stdin. Could somebody give a working example jsut in case i messed it up somehow.

I need it to read the running cmd window and echo it back out to another app that it trying to read that info. I hope that makes since.

The latest barts pe does not allow at all for redirecting to another app to do after build but before creating the cd clean up and stuff. So I created a wrapper that calls my cleaning scripts. But I would still like to redirect output back to barts pe for it to parse.

Share this post


Link to post
Share on other sites

This commandline program here, sends the output to clipboard.

cb is a simple command-line program to send input to the clipboard. It comes most useful when trying to capture the output from another program.

For example:

if you execute `dir /b /on | cb' the contents of the current directory will be copied to the clipboard

Note: The format to send the ouput of one program to another program is:

`prog1 | prog2'.

Share this post


Link to post
Share on other sites

thank you for that but I dont think the other app reads from the clipboard. All that is needed here is a simple pipe that pipes all the stuff from stdin to stdout.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0