Setting the CMD Defaults programmatically

G

Guest

Hi,

I'm trying to find a way to set the CMD prompt defaults programmatically.
For instance I want to set the CMD window position to a fixed position. I
can set it up by hand, using the System menu Defaults, but I cannot find
where these settings are placed (registry ? INI file ?). Does anyone knows
this ?
The obvious registry path, "HKLM\Software\Microsoft\Command Processor",
seems not to be the right answer.

Thanks.

Massimo.
 
M

Matthias Tacke

Hi,

I'm trying to find a way to set the CMD prompt defaults programmatically.
For instance I want to set the CMD window position to a fixed position. I
can set it up by hand, using the System menu Defaults, but I cannot find
where these settings are placed (registry ? INI file ?). Does anyone knows
this ?
The obvious registry path, "HKLM\Software\Microsoft\Command Processor",
seems not to be the right answer.
Since part of the information is stored in the link you use to start the
shell, I prefer controlling the pos from inside the batch with a 3rd party
tool like cmdow from Ritchie Lawrence [1]

You can get the standard configuration by reading the registry
reg query "HKCU\console" /S
Some values have to be decoded, see the batch[3]:

Another useful program to tweak the console is conset from Frank P.
Westlake [2]

With both mentioned programs and this batch you get maximum size console:
::ConEnlarge.cmd:::::::::::::::::::::::::::::::::::::::::::::::::::::
@echo off
setlocal
Cmdow @ /MAX
ConSet /s
ConSet ConSet_W_cols=%ConSet_maxwin_xy:~,3%
ConSet ConSet_W_lines=%ConSet_maxwin_xy:* =%"
::ConEnlarge.cmd:::::::::::::::::::::::::::::::::::::::::::::::::::::

[1] <http://www.commandline.co.uk/cmdow/>
[2] <http://gearbox.maem.umr.edu/batch/f_w_util/Frank_Westlake-Freeware.html>
[3]
::ConsoleSizes.cmd::::::::::::::::::::::::::::::::::::::::::::::::::::
@echo off
setlocal
echo Window_X*Y_^|_Buffer_X*Y_^|_App-key_____________________________
for /F "tokens=1-2,*" %%A in (
'reg query hkcu\console /s^|findstr "\ ScreenBufferS WindowS"') do (
if "%%B" NEQ "REG_DWORD" (set "HKCUCon=%%A %%B %%C"&set "SBS="&SET "WS=")
if "%%A" EQU "ScreenBufferSize" set "SBS=%%C"
if "%%A" EQU "WindowSize" set "WS=%%C" & call :display)
goto :eof
:display
set /A "WSW=WS&0xffff, WSH=WS>>16"
set "WSW= %WSW%"&set "WSH=%WSH% "
set /A "SBW=SBS&0xffff, SBH=SBS>>16"
set "SBW= %SBW%"&set "SBH=%SBH% "
set "HKCUCon=%HKCUCon:HKEY_CURRENT_USER=HKCU%"
echo/%WSW:~-5%*%WSH:~,5%^|%SBW:~-5%*%SBH:~,5% ^| %HKCUCon%
::ConsoleSizes.cmd::::::::::::::::::::::::::::::::::::::::::::::::::::

HTH
 
U

Urpiano Cedazo

You must look at "HKCU\Software\Microsoft\Command Processor" and at
"HKCU\Console"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top