Preposition CMD Window

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.
 
K

Konrad Kullig

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

regards
Konrad Kullig
 
D

David Wang [Msft]

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
 
A

Alex K. Angelopoulos [MVP]

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...
 
M

Michael Bednarek

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.
 
A

Alex K. Angelopoulos [MVP]

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.
 
M

Michael Bednarek

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