matthewdowney20 Posted August 13, 2012 Posted August 13, 2012 Hey everyone, I am currently in the process of coding a program for command line use, and I want to be abe to print back to the command line, like this: C:\Users\Matthew>myprogram Output from my program C:\Users\Matthew> Any ideas? Here is what I have already tried: (myprogram.au3) $MyCommand = 'dir' Run(@ComSpec & " /c " & $MyCommand, @SystemDir, @SW_Show) Run(@ComSpec & " /c @echo off && echo Command completed successfully. && @echo on && pause", @SystemDir, @SW_Show) The output from this ended up opening three windows, from window 1 (command line) I ran "myprogram" whcih in turn opened another window for the "dir" and yet another window to print back "Command completed successfully." I am looking for a way to do this all in the same window, to write to the active shell so to speak. Thanks for any help!
JohnQSmith Posted August 14, 2012 Posted August 14, 2012 Every time you do a "Run(@ComSpec...", it's going to open a new window.To write to the console, look at ConsoleWrite(). As the help file says, you'll have to compile your script as a console application. Whenever someone says "pls" because it's shorter than "please", I say "no" because it's shorter than "yes".
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now