Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > VB Script

Vista - Start compmgmt.msc maximized?

Reply
 
Old 08-30-2008   #1 (permalink)
Tyler Durden


 
 

Start compmgmt.msc maximized?

Is it possible a vbscript to start compmgmt.msc maximized?

Thanks to everyone!





My System SpecsSystem Spec
Old 08-30-2008   #2 (permalink)
Pegasus \(MVP\)


 
 

Re: Start compmgmt.msc maximized?


"Tyler Durden" <abuse@xxxxxx> wrote in message
news:%230N$%231oCJHA.4916@xxxxxx
Quote:

> Is it possible a vbscript to start compmgmt.msc maximized?
>
> Thanks to everyone!
>
Each time someone asks "Is it possible" I am tempted to give a straight
answser and say "Yes, it is possible." However, since you probably wanted to
ask "How can I start this snap-in maximised", here is an answer:

Set WshShell = CreateObject("WScript.Shell")
WshShell.run "cmd.exe /c compmgmt.msc", 0, False
WScript.sleep 15000
WshShell.SendKeys("% x")

Note that the script is fragile like all scripts that involve the SendKeys
method. The delay of 15 seconds may be excessive or inadequate, depending on
the number of disks and partitions that the snap-in has to process.


My System SpecsSystem Spec
Old 08-30-2008   #3 (permalink)
Tyler Durden


 
 

Re: Start compmgmt.msc maximized?

Thank you, Pegasus. But the SendKeys method would be inadequate since the
script, that would starts other applications too, could be run on non
english XP installations.

Do you know of any freeware, small executable to start applications in a
maximized window?.


"Pegasus (MVP)" <I.can@xxxxxx> wrote in message
news:uyjTbWqCJHA.2060@xxxxxx
Quote:

>
> "Tyler Durden" <abuse@xxxxxx> wrote in message
> news:%230N$%231oCJHA.4916@xxxxxx
Quote:

>> Is it possible a vbscript to start compmgmt.msc maximized?
>>
>> Thanks to everyone!
>>
>
> Each time someone asks "Is it possible" I am tempted to give a straight
> answser and say "Yes, it is possible." However, since you probably wanted
> to ask "How can I start this snap-in maximised", here is an answer:
>
> Set WshShell = CreateObject("WScript.Shell")
> WshShell.run "cmd.exe /c compmgmt.msc", 0, False
> WScript.sleep 15000
> WshShell.SendKeys("% x")
>
> Note that the script is fragile like all scripts that involve the SendKeys
> method. The delay of 15 seconds may be excessive or inadequate, depending
> on the number of disks and partitions that the snap-in has to process.
>

My System SpecsSystem Spec
Old 08-30-2008   #4 (permalink)
Pegasus \(MVP\)


 
 

Re: Start compmgmt.msc maximized?


"Tyler Durden" <abuse@xxxxxx> wrote in message
news:u7sTaouCJHA.4932@xxxxxx
Quote:

> Thank you, Pegasus. But the SendKeys method would be inadequate since the
> script, that would starts other applications too, could be run on non
> english XP installations.
>
> Do you know of any freeware, small executable to start applications in a
> maximized window?.
Sorry, I don't.


My System SpecsSystem Spec
Old 08-31-2008   #5 (permalink)
Al Dunbar


 
 

Re: Start compmgmt.msc maximized?


"Pegasus (MVP)" <I.can@xxxxxx> wrote in message
news:%239yz8wvCJHA.4380@xxxxxx
Quote:

>
> "Tyler Durden" <abuse@xxxxxx> wrote in message
> news:u7sTaouCJHA.4932@xxxxxx
Quote:

>> Thank you, Pegasus. But the SendKeys method would be inadequate since the
>> script, that would starts other applications too, could be run on non
>> english XP installations.
>>
>> Do you know of any freeware, small executable to start applications in a
>> maximized window?.
>
> Sorry, I don't.
CMD.EXE can do that in most cases, i.e.:

start /max notepad.exe

This works for MMC.EXE as well:

Set WshShell = CreateObject("WScript.Shell")
WshShell.run "cmd.exe /c start /max mmc.exe", 0, False

Unfortunately, however, this does not work:

Set WshShell = CreateObject("WScript.Shell")
WshShell.run "cmd.exe /c start /max mmc.exe %windir%\system32\compmgmt.msc",
0, False


as the xml code in the .mmc file includes settings such as the window size.

If you want compmgmt.msc to always open maximized, you will have to open it
in author mode, maximize its window, and save it - either back to
%windir%\system32 or somewhere else.


/Al


My System SpecsSystem Spec
Old 09-01-2008   #6 (permalink)
Tyler Durden


 
 

Re: Start compmgmt.msc maximized?

That's exactly what I mean, it's almost unbelievable that there is no neat
way to do this. And it's a very common administrative task that I have to
repeat on a lot of networked and standalone computers.


"Al Dunbar" <AlanDrub@xxxxxx> wrote in message
news:e66O9z6CJHA.3576@xxxxxx
Quote:

>
> "Pegasus (MVP)" <I.can@xxxxxx> wrote in message
> news:%239yz8wvCJHA.4380@xxxxxx
Quote:

>>
>> "Tyler Durden" <abuse@xxxxxx> wrote in message
>> news:u7sTaouCJHA.4932@xxxxxx
Quote:

>>> Thank you, Pegasus. But the SendKeys method would be inadequate since
>>> the script, that would starts other applications too, could be run on
>>> non english XP installations.
>>>
>>> Do you know of any freeware, small executable to start applications in a
>>> maximized window?.
>>
>> Sorry, I don't.
>
> CMD.EXE can do that in most cases, i.e.:
>
> start /max notepad.exe
>
> This works for MMC.EXE as well:
>
> Set WshShell = CreateObject("WScript.Shell")
> WshShell.run "cmd.exe /c start /max mmc.exe", 0, False
>
> Unfortunately, however, this does not work:
>
> Set WshShell = CreateObject("WScript.Shell")
> WshShell.run "cmd.exe /c start /max mmc.exe
> %windir%\system32\compmgmt.msc", 0, False
>
>
> as the xml code in the .mmc file includes settings such as the window
> size.
>
> If you want compmgmt.msc to always open maximized, you will have to open
> it in author mode, maximize its window, and save it - either back to
> %windir%\system32 or somewhere else.
>
>
> /Al
>
>

My System SpecsSystem Spec
Old 09-02-2008   #7 (permalink)
Al Dunbar


 
 

Re: Start compmgmt.msc maximized?

LOL, there are a lot of things for which "there is no neat way to do this",
or, alternately, much of what is doable, is doable in a task-specific
manner.

But if you want compmgmt.msc to always open maximized on every computer, you
could make the change on one computer and copy the .msc file to all the
others - there is no need to open each .msc file in author mode on more than
one system.

/Al

"Tyler Durden" <abuse@xxxxxx> wrote in message
news:uoxWGWDDJHA.3908@xxxxxx
Quote:

> That's exactly what I mean, it's almost unbelievable that there is no neat
> way to do this. And it's a very common administrative task that I have to
> repeat on a lot of networked and standalone computers.
>
>
> "Al Dunbar" <AlanDrub@xxxxxx> wrote in message
> news:e66O9z6CJHA.3576@xxxxxx
Quote:

>>
>> "Pegasus (MVP)" <I.can@xxxxxx> wrote in message
>> news:%239yz8wvCJHA.4380@xxxxxx
Quote:

>>>
>>> "Tyler Durden" <abuse@xxxxxx> wrote in message
>>> news:u7sTaouCJHA.4932@xxxxxx
>>>> Thank you, Pegasus. But the SendKeys method would be inadequate since
>>>> the script, that would starts other applications too, could be run on
>>>> non english XP installations.
>>>>
>>>> Do you know of any freeware, small executable to start applications in
>>>> a maximized window?.
>>>
>>> Sorry, I don't.
>>
>> CMD.EXE can do that in most cases, i.e.:
>>
>> start /max notepad.exe
>>
>> This works for MMC.EXE as well:
>>
>> Set WshShell = CreateObject("WScript.Shell")
>> WshShell.run "cmd.exe /c start /max mmc.exe", 0, False
>>
>> Unfortunately, however, this does not work:
>>
>> Set WshShell = CreateObject("WScript.Shell")
>> WshShell.run "cmd.exe /c start /max mmc.exe
>> %windir%\system32\compmgmt.msc", 0, False
>>
>>
>> as the xml code in the .mmc file includes settings such as the window
>> size.
>>
>> If you want compmgmt.msc to always open maximized, you will have to open
>> it in author mode, maximize its window, and save it - either back to
>> %windir%\system32 or somewhere else.
>>
>>
>> /Al
>>
>>
>
>

My System SpecsSystem Spec
Old 09-03-2008   #8 (permalink)
\RemS


 
 

Re: Start compmgmt.msc maximized?

'''''''''''''''''''''''''''''''
strCMD = "mmc.exe compmgmt.msc"

Set WshShell = CreateObject("Wscript.Shell")

With GetObject("winmgmts:Win32_Process")
Set oInParams = .Methods_("Create").InParameters.SpawnInstance_
oInParams.CommandLine = strCMD
Set oOutParams = .ExecMethod_("Create", oInParams)
strPID = oOutParams.ProcessId
returned = oOutParams.ReturnValue
End With

While WshShell.AppActivate(strPID) = FALSE
wscript.sleep 500
Wend

If returned = 0 Then
WshShell.AppActivate strPID
If WshShell.AppActivate(strPID) then _
WshShell.SendKeys "(% )" & "{DOWN}{DOWN}{DOWN}{DOWN}~"

Wsh.sleep 99 : WshShell.SendKeys("^")
End If
'''''''''''''''''''''''''''''''

As "Pegasus (MVP)" already wrote:
Note that the script is fragile like all scripts that involve the SendKeys
method. !


\Remco
My System SpecsSystem Spec
Old 09-08-2008   #9 (permalink)
Tyler Durden


 
 

Re: Start compmgmt.msc maximized?

Gilles,

I really thank you, that's *exactly* what I was looking for. Worked
perfectly, and I hope that helps someone else too (certainly will).

Thank you!


"Gilles LAURENT [MVP]" <glsft@xxxxxx> wrote in message
news:ek9p483DJHA.1184@xxxxxx
Quote:

> "Tyler Durden" <abuse@xxxxxx> a écrit dans le message de
> news:u7sTaouCJHA.4932@xxxxxx
>
> Hi Tyler,
>
> [...]
> | Do you know of any freeware, small executable to start applications
> | in a maximized window?.
>
> My tool StartMax (freeware) is maybe what you need ;-)
> http://glsft.free.fr/index.php?optio...d=52&Itemid=28
>
> --
> Gilles LAURENT
> MVP Windows Server - Admin Frameworks
> http://glsft.free.fr
>
>

My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
How Do I Get Maximized Windows? Vista General
opening a program maximized Vista General
Glass effect when maximized Vista General
Maximized Windows Vista General


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46