Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

My team has just migrated to Win 7. We have a batch file that is no longer working. Here is the line that has a problem.

start "NameOfWindow" /DSomeDirWeWantCWD ..\SomeDir\SomeNameOfAnEXE m

Under Win XP this command does the following. 1. Executes "SomeNameOfAnEXE" located in directory "SomeDir" 2. Sets the Current Working Directory of the executed process to "SomeDirWeWantCWD" 3. Sets the name of the window to "NameOfWindow"

Under Win 7 step number 3 is not working. The window title becomes.... "C:\FullPathTo\SomeDir\SomeNameOfAnEXE.exe"

What command to I run to get the same behavior in Win 7 and Win XP?

I need to change the name of the window because we have scripts that run that use the window name to hook in commands.

share|improve this question
add comment

2 Answers

You can enter the command title <NameOfWindow> for the window title to be set.

share|improve this answer
    
This changes the title of the command window. This does NOT change the title of the window that is launched from the "start" command. –  Miebster Oct 22 '12 at 15:24
    
I've tried that on Windows 7 and it worked fine. I used the same syntax: start "Name" <Command>. But it was a Java process in my case. –  AbhishekGirish Oct 22 '12 at 16:30
    
It appears to work for some things launched from cmd (but not all?) –  Miebster Oct 22 '12 at 17:39
    
Is the application you launch a GUI? Setting the title always works in case of CLI applications. But if it's an application, the application has to be programmed to set the title. For example, if its a Java Swing UI, you will have to use Frame.setTitle() (or JFrame). –  AbhishekGirish Oct 22 '12 at 17:52
    
What did u mean by "Did ya barf?" –  AbhishekGirish Oct 22 '12 at 18:05
add comment
up vote 0 down vote accepted

It turned out to be an admin issue with Win 7. We worked around it with this.

start cmd.exe /k "cd SomeDirWeWantCWD & title NameOfWindow & ..\SomeDir\SomeNameOfAnEXE m"
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.