Mombu the Microsoft Forum

Mombu the Microsoft Forum > Microsoft > Windows 2000 Server (TECHNET) > Setting the CMD Defaults programmatically
REGISTER NOW! Search Today's Posts Mark Forums Read




Reply
 
Thread Tools Search this Thread Display Modes
1 27th September 06:32
mpiceni
External User
 
Posts: 1
Default Setting the CMD Defaults programmatically



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.
  Reply With Quote
SPONSORED LINKS BY GOOGLE

 


2 27th September 06:32
matthias tacke
External User
 
Posts: 1
Default Setting the CMD Defaults programmatically



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

--
Greetings
Matthias
  Reply With Quote
3 11th October 21:18
urpiano cedazo
External User
 
Posts: 1
Default Setting the CMD Defaults programmatically


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

--
Un saludo
Urpiano Cedazo

<mpiceni@newsgroup.nospam> escribió en el mensaje de noticias
news:unHAPMBAIHA.5184@TK2MSFTNGP02.phx.gbl...
  Reply With Quote
SPONSORED LINKS BY GOOGLE

 


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes







Copyright © 2006 SmartyDevil.com - Dies Mies Jeschet Boenedoesef Douvema Enitemaus -
Also visit Ogoun the Usenet Archive
666