Preposition CMD Window

  • Thread starter Thread starter Zodiac
  • Start date Start date
Z

Zodiac

Hi All,

Do any of you know if its possible do open CMD window with a predefined
size (not the default) and location on the screen?

I would like to open a small CMD window right above the clock to show me
some status messages...

rgds,

Z.
 
- start CMD via shortcut
- define size and position in this shortcut

regards
Konrad Kullig
 
And notice that this info gets written in the Registry under the
HKCU\Console key, so it is quite easy to move this configuration with the
shortcut around.

--
//David
IIS
This posting is provided "AS IS" with no warranties, and confers no rights.
//
- start CMD via shortcut
- define size and position in this shortcut

regards
Konrad Kullig
 
David said:
And notice that this info gets written in the Registry under the
HKCU\Console key, so it is quite easy to move this configuration with
the shortcut around.

Interesting point!

On XP, for example, there are at least 30 different parameters which can be
set this way. You could do it programmatically.

The relevant parameter would be WindowPosition; it's a DWORD value, with the
second byte corresponding to the top of the window and the 4th byte
corresponding to the left side of the window. So, for example, a hex value
of 0x00800020 would mean that the top is x80 (or 128 decimal) pixels down
from the top and the left side is 0x20 (32 decimal) pixels from the left...
 
Interesting point!

On XP, for example, there are at least 30 different parameters which can be
set this way. You could do it programmatically.

The relevant parameter would be WindowPosition; it's a DWORD value, with the
second byte corresponding to the top of the window and the 4th byte
corresponding to the left side of the window. So, for example, a hex value
of 0x00800020 would mean that the top is x80 (or 128 decimal) pixels down
from the top and the left side is 0x20 (32 decimal) pixels from the left...

These values are written to the registry only for consoles which were
invoked through Explorer's Run box or similar mechanisms. In my
experience, consoles started from a shortcut (LNK) get their properties
from that shortcut, and any interactive modifications of those settings
are written back to that shortcut.
 
These values are written to the registry only for consoles which were
invoked through Explorer's Run box or similar mechanisms. In my
experience, consoles started from a shortcut (LNK) get their properties
from that shortcut, and any interactive modifications of those settings
are written back to that shortcut.

I just checked back and I see this behavior - not preserving the settings if
not shell exec'd - as you said on XP Pro SP1. So much for that idea.
 
Back
Top