![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| 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. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Start compmgmt.msc maximized? Is it possible a vbscript to start compmgmt.msc maximized? Thanks to everyone! |
My System Specs![]() |
| | #2 (permalink) |
| | 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! > 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 Specs![]() |
| | #3 (permalink) |
| | 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 Specs![]() |
| | #4 (permalink) |
| | 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?. |
My System Specs![]() |
| | #5 (permalink) |
| | 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. 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 Specs![]() |
| | #6 (permalink) |
| | 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 Specs![]() |
| | #7 (permalink) |
| | 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 Specs![]() |
| | #8 (permalink) |
| | 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 Specs![]() |
| | #9 (permalink) |
| | 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 Specs![]() |
![]() |
| 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 | |||