pstein

Extraordinary Member
Joined
Mar 20, 2010
Messages
454
When I start a DOS batch file *.bat procedure then a cmdprompt window opens with the default
number of columns and rows.

In old WinXP I could pause the batch script and change the number of columns/rows of this terminal/cmdprompt windowa as well as other parameters like font size.

AND (this is important !) these changes apply ONLY FOR THE current batch script name.

When I start another batch script then the default values are taken again (until I individualize them here again for this particular batch script). As far as I can see WinXP associated the actual batch script to the number of cols/rows by the title name of the cmdprompt (which can be changed by the "title" command inside the batch script.

In Windows 7 this all does seem to work any more. All batch scripts work with the same cmdprompt window size.
When I change it for ONE batch script then it applies for all others as well.

Is there a workaround/gimmick to individualize it here as well?

Maybe there is a command to set the num of cols/rows from inside the batch script ?

Peter
 

Solution
In Windows 7 and newer versions, adjusting the console window (cmd prompt) properties dynamically for individual batch scripts as you described in Windows XP is not directly supported. However, there are ways to modify the appearance of the console window within a batch script. One approach is to use the mode command within the batch script to modify the console window properties like screen buffer size, window size, and font size. This command allows you to change the number of columns and rows for the console window. However, these changes will apply to all instances of console windows opened, not just for a specific batch script. Here's how you can use the mode command to adjust the console window properties within a...
In Windows 7 and newer versions, adjusting the console window (cmd prompt) properties dynamically for individual batch scripts as you described in Windows XP is not directly supported. However, there are ways to modify the appearance of the console window within a batch script. One approach is to use the mode command within the batch script to modify the console window properties like screen buffer size, window size, and font size. This command allows you to change the number of columns and rows for the console window. However, these changes will apply to all instances of console windows opened, not just for a specific batch script. Here's how you can use the mode command to adjust the console window properties within a batch script:
Code:
@echo off mode CON: COLS=100 LINES=50 REM Your batch script commands here pause
In the above example, the mode command sets the console window to have 100 columns and 50 rows. You can adjust these values to suit your requirements. Unfortunately, there isn't a built-in way in Windows 7 or newer to dynamically change console window settings for specific batch scripts only. The console window settings are system-wide and apply to all instances of the command prompt. If you're looking for script-specific behavior, you might need to explore third-party tools or scripting solutions that can manage individual console window settings per script, though this may involve more complex interactions outside of the default batch script functionality. Feel free to try the mode command in your batch scripts to see if it meets your needs within the limitations of the Windows operating system.
 

Solution
Back
Top