Jump to content
Sign in to follow this  

Set DOS command window title?

Recommended Posts

I want to run an EXE (which opens a dos window), but Instead of the window title being the location ofthe file, I want it to be preset.

The problem I am having is that WinGetTitle only seems to work with Windows windows and not DOS windows, if that makes any sense.

Share this post

Link to post
Share on other sites

so to run a dos exe in a specific titled dos window would be

Run("cmd /K title This title is OWNED")

ControlSend("This title is OWNED", "", "", "whatever.exe")

ControlSend("This title is OWNED", "", "", {ENTER}

like that?

Share this post

Link to post
Share on other sites

Run(@ComSpec & ' /K title this is owned|dir')

Edit: fixed quotes

I'm sorry but I cannot get to my destination with the information given. I don't have any idea what the help file istalking about with @comspec.

Here's what I need.

create the variable that holds the directory location of the exe. (This I can do)

Run the DOS program (path in a variable) in a window and title that window something specific.

Send '1' to that window

Send ENTER to that window

close that window.

it's not a built in dos command like DIR or COPY.

The exe command is going to have a %1 too, it will be like:

testing.exe > c:\output.txt

When I try to change compspec to anything I need it doesnt work and opens a new window

Share this post

Link to post
Share on other sites

doesn't have to be a built in command, just using a standard window command as example


Run(@ComSpec & ' /K title this is owned')
WinWaitActive('this is owned')

SciTE for AutoItDirections for Submitting Standard UDFs


Don't argue with an idiot; people watching may not be able to tell the difference.


Share this post

Link to post
Share on other sites

If an exe spaws an arbitrary DOS window or two (such as Ghost32 8.0 or DOSBox), there should either be a way to set the title--or the help file should document the limitation.

When I just tested now, I was always able to set the title of DOS windows....

Remember that WinSetTitle has three parameters:

;WinSetTitle($oldTitle, $text, $newTitle)

WinSetTitle("C:\Windows", "", "My New Title")

It could also be that the window title begins with some invisible charatcter, so also try putting

Opt("WinTitleMatchMode", 2) at the top of your script.

You can also see if WinExists(..... and similar functions are able to detect the DOS window.

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  

  • Create New...