Jump to content
Sign in to follow this  

Reading output of hidden cmd.exe window?

Recommended Posts


Well, I am using id3.exe to read/set ID3-Tags on my MP3 audiofiles. Setting is not really a problem using ShellExecuteWait().

Reading the current ID3-Tag from *.mp3 files using

ShellExecuteWait("id3.exe", "-2 -q %a a.mp3")

works aswell, just somehow I want to grab the data that is given back by id3.exe in cmd.exe window (in this case it prints out the artist's name).

So how do I read what's printed in cmd.exe window? Somewhere on the forum I saw someone who was using $cmdtext = ClipGet(), but that didn't work for me.

Is that even possible when I'm hiding the window using @SW_HIDE?

Thing is, I do not want the black window being visible all the time I tag my files.

Any help appreciated!

Share this post

Link to post
Share on other sites

Look at Run() and StdOutRead() in the help file and note the example script under StdOutRead() runs with @SW_HIDE.

Here's a minimal version:

#include <Constants.au3>

Local $iPID = Run(@ComSpec & " /c Ver", @SystemDir, @SW_HIDE, $STDOUT_CHILD)
Local $sStdOut = ""
While 1
    $sStdOut &= StdoutRead($iPID)
    If @error Then ExitLoop

MsgBox(64, "Result", $sStdOut)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

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  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...