2

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 do 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.

2 Answers 2

2

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"
1

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

5
  • 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, 2012 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.
    – agirish
    Oct 22, 2012 at 16:30
  • It appears to work for some things launched from cmd (but not all?)
    – Miebster
    Oct 22, 2012 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).
    – agirish
    Oct 22, 2012 at 17:52
  • What did u mean by "Did ya barf?"
    – agirish
    Oct 22, 2012 at 18:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .