0

Let me explain like this: if I click on a Command Prompt icon in Windows 10, I get a window titled "Command Prompt" (I guess, we could call this "the title") - and if I right-click on the title bar of this window, and click Properties, it also says "Command Prompt" in the title bar of the Properties window as well (I guess we can call this "the window name"):

command prompt A

However, if I have a batch script, test.bat with these contents (see also https://ss64.com/nt/title.html):

title My Batch Title
pause

... and I double-click it, I get this:

command prompt B

... that is, the batch file cmd.exe window did get the title "My Batch Title" - but if you right-click/Properties, then the window name is "C:\WINDOWS\system32\cmd.exe" - and that would mean, that all other batch scripts will have the same window name.

I care for this because I'd like to have Windows remember manual position and size of some of my BATCH script windows, and Size batch windows and set in specific location implies that is done via title, but I'm changing the title, and have unchecked "Let system position window", and window position and size is still not remembered ... SO in this case, I think this means Windows is unable to honor unchecked "Let system position window", because Windows looks up the manual window size/position by window name, not by title - and "C:\WINDOWS\system32\cmd.exe" as window name is certainly not unique to my batch file.

So, is there a command I could use from a BATCH file, to change not just the title, but the window name of the cmd.exe window that gets spawned by the BATCH file?

sdbbs
  • 4,270
  • 5
  • 32
  • 87

1 Answers1

0

Create shortcuts to your batchfiles.
Set the desired positioning in these shortcuts.
If you start the same batchfiles multiple times create multiple shortcuts with the appropriate positioning.
Start the batchfiles using the shortcuts and these will use the positioning set in the shortcuts.
No need to fiddle with window names/titles.
I often use Title %~n0 at the start of batchfiles so the window shows the name of the running script but that is unrelated to the positioning on the screen.

OJBakker
  • 602
  • 1
  • 5
  • 6