Automated setup of DOS command window
Moderator: DosItHelp
Re: Automated setup of DOS command window
I would like to automate another thing:
is it possible to set the DOS (CMD) window position from batch file? (so it is always at the same XY position).
Saso
is it possible to set the DOS (CMD) window position from batch file? (so it is always at the same XY position).
Saso
Re: Automated setup of DOS command window
I'm sure I saw that when I found the powershell solution (above) to the buffer/window width/height issue. Check the powershell command.
I didn't see a need so I ignored it.
I didn't see a need so I ignored it.
-
- Expert
- Posts: 960
- Joined: 15 Jun 2012 13:16
- Location: Italy, Rome
Re: Automated setup of DOS command window
Hi,
i don't know powershell, but i think that powershell can resolve this.
I know a method for create a configuration for a dos windows with a given title.
You can view the usage in this post
I hope this is usefull
einstein1969
i don't know powershell, but i think that powershell can resolve this.
I know a method for create a configuration for a dos windows with a given title.
You can view the usage in this post
I hope this is usefull
einstein1969
Re: Automated setup of DOS command window
This all said, I'd still like to find a code solution to items 1 and 3 above, since I am writing scripts that others will use, and I can't rely on them to mess around with CMD properties!
Re: Automated setup of DOS command window
Maybe it solves your problem, not mine... sigh
Re: Automated setup of DOS command window
Yes, of course. Sorry for 'stealing' your thread. Maybe admin can delete these unnecessary posts.
Saso
Saso
Re: Automated setup of DOS command window
@penpen
@foxidrive
So is there a code solution to items 1 and 3? The above solutions only work for me- not the other users that use my scripts.
@foxidrive
So is there a code solution to items 1 and 3? The above solutions only work for me- not the other users that use my scripts.
Re: Automated setup of DOS command window
These settings are saved in the registry at:
Maybe you could update these settings to:
just before starting (see this: viewtopic.php?f=3&t=4285) the new instance of .cmd and remove these settings (restore previous settings if any)?
I took another look at your post viewtopic.php?p=34609#p34609 and I see that your original .cmd window has a title of 'Visual Fortran ....'
Maybe this is the reason why things are not working as expected? Maybe you should modify those settings?
If I set the settings mentioned in the beginning of this post everytime I 'START' a new .cmd window it has Lucida Console font etc.
Saso
(XP PRO, 32bit)
Code: Select all
HKCU\Console\%SystemRoot%_system32_cmd.exe
Maybe you could update these settings to:
Code: Select all
QuickEdit REG_DWORD 1
FaceName REG_SZ "Lucida Console"
just before starting (see this: viewtopic.php?f=3&t=4285) the new instance of .cmd and remove these settings (restore previous settings if any)?
I took another look at your post viewtopic.php?p=34609#p34609 and I see that your original .cmd window has a title of 'Visual Fortran ....'
Maybe this is the reason why things are not working as expected? Maybe you should modify those settings?
If I set the settings mentioned in the beginning of this post everytime I 'START' a new .cmd window it has Lucida Console font etc.
Saso
(XP PRO, 32bit)
Re: Automated setup of DOS command window
That seems to work! Although I had hoped not to have to go into the registry as this needs Admin rights.
Just tried to query this value:
D:\>reg query "HKCU\Console\%SystemRoot%_system32_cmd.exe" /v FaceName
ERROR: The system was unable to find the specified registry key or value.
Since:
SystemRoot=C:\Windows
I suspect it's the \ in C:\Windows which confuses reg.exe
I tried \\ but that didn't work, so I'm not sure what the syntax is for:
reg query "HKCU\Console\C:\Windows_system32_cmd.exe" /v FaceName
Just tried to query this value:
D:\>reg query "HKCU\Console\%SystemRoot%_system32_cmd.exe" /v FaceName
ERROR: The system was unable to find the specified registry key or value.
Since:
SystemRoot=C:\Windows
I suspect it's the \ in C:\Windows which confuses reg.exe
I tried \\ but that didn't work, so I'm not sure what the syntax is for:
reg query "HKCU\Console\C:\Windows_system32_cmd.exe" /v FaceName
Re: Automated setup of DOS command window
Code: Select all
C:\Users\Squashman>reg query "HKCU\Console" /v FaceName
HKEY_CURRENT_USER\Console
FaceName REG_SZ Terminal
Re: Automated setup of DOS command window
No, FaceName for me is not in the key Console, it is in a key beneath Console called %SystemRoot%_system32_cmd.exe:
HKEY_CURRENT_USER\Console\%SystemRoot%_system32_cmd.exe
This is the problem: %SystemRoot% has a backslash in it.
HKEY_CURRENT_USER\Console\%SystemRoot%_system32_cmd.exe
This is the problem: %SystemRoot% has a backslash in it.
Re: Automated setup of DOS command window
Is the Key name acutally %SystemRoot%?
Then I would try this in a batch file.
reg query "HKCU\Console\%%SystemRoot%%_system32_cmd.exe" /v FaceName
Then I would try this in a batch file.
reg query "HKCU\Console\%%SystemRoot%%_system32_cmd.exe" /v FaceName
Re: Automated setup of DOS command window
Nope, still not working:
D:\>reg query "HKCU\Console\%%SystemRoot%%_system32_cmd.exe" /v FaceName
ERROR: The system was unable to find the specified registry key or value.
Here is my regedit view:
D:\>reg query "HKCU\Console\%%SystemRoot%%_system32_cmd.exe" /v FaceName
ERROR: The system was unable to find the specified registry key or value.
Here is my regedit view:
Re: Automated setup of DOS command window
In a BATCH file. Not at the cmd prompt.