Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

MSInfo32

Posted on 2006-05-05
17
Medium Priority
?
566 Views
Last Modified: 2011-10-03
I can run MSInfo32 from a command button with :

                Dim objProcess As New Process()
                objProcess.Start(<path>)
                objProcess.WaitForExit()
                objProcess.Dispose()
                objProcess = Nothing

... but the process exits as soon as it starts (MSInfo32 is displayed and stays up) and so blasts through WaitForExit (in effect, I am trying to make it modal).  Can anyone explain whats happening and how I can get control of this so that I can close MSInfo if my app exits, for example.  The same code performs as expected calling other applications (eg MSPaint).
0
Comment
Question by:StewartJ
  • 9
  • 8
17 Comments
 
LVL 96

Expert Comment

by:Bob Learned
ID: 16613944
Ok, here's what I have discovered:

1) MSINFO32.EXE starts the real process (C:\Program Files\Common Files\Microsoft Shared\MSInfo\OINFOP11.EXE)

2) I tried this code:

   Dim info As New Process

    info.StartInfo.FileName = "MSINFO32.EXE"
    info.StartInfo.WindowStyle = ProcessWindowStyle.Normal
    info.StartInfo.CreateNoWindow = False

    info.Start()

    info.WaitForExit()

    MessageBox.Show("Completed")

3) The 'Completed' got displayed twice.

4) I opened up the Task Manager, set the display order to CPU usage (descending), and selected an item on the MSINFO form that would make it get the information, and saw the name rise to the top of the list.

Bob
0
 
LVL 2

Author Comment

by:StewartJ
ID: 16614404
Thanks.

You seem to be on the right lines - its spawning another process that I'm not seeing.

Seems OS specific - the Win2K machine I'm using for this displays through MMC using an MSInfo32.msc file.  My NT4 machine appears to use MSInfo32.exe directly.  Neither has OINFOP11.EXE installed.  What's your OS?

Problem now seems to be 'how do I identify and grab the spawned process?'.

0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 16616526
1) Windows XP

2) Look at item #4 above ^^^^

Bob
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 2

Author Comment

by:StewartJ
ID: 16628544
Bob,

Your point 1 is an ad ??? - and I need to get this to work on NT and 2K as well as XP

Your point 2 (#4) - yes, I saw that and thanks but I dont see any easy way to use that programmatically without a lot of coding.


Stewart
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 16630094
1) I don't have anything but Windows XP at my disposal, so I can't help you.
2) That is not a programming thing, it is a manual process requiring observation, so that you know what the 2nd process is.

Bob
0
 
LVL 2

Author Comment

by:StewartJ
ID: 16630107
OK.  Thanks for your help anyway.

Stewart
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 16630172
No, I am still trying to help here.  Go to a 2000 machine, start the Task Manager, start the MSINFO process, click on an option on the screen that takes a while to  process, and look at the process list to see if there is a 2nd process associated with MSINFO32 running.

Bob
0
 
LVL 2

Author Comment

by:StewartJ
ID: 16630286
All I am seeing on W2K is mmc.exe.

Pointing Spy+ at it (with the Components option of MSInfo selected) gives me :

"System Information" MMCMainFrame
     "" MDIClient
          "System Information\Components" MMCChildFrm
               {various low level control windows}

0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 16633443
You have to switch to the Processes tab.

Bob
0
 
LVL 2

Author Comment

by:StewartJ
ID: 16637197
Yes, I had.  It shows as mmc.exe
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 16638627
Confused.  Are you saying that it runs in the management console?

Bob
0
 
LVL 2

Author Comment

by:StewartJ
ID: 16638635
Yes - on 2K, not NT.  I'm confused too.  Im not sure that trying to untangle this is worth the effort !!
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 16638699
Ok, so when you start MSINFO32.EXE, it starts MMC.EXE also?  There are your 2 processes.

Bob
0
 
LVL 2

Author Comment

by:StewartJ
ID: 16638712
msinfo quits immediately.  mmc is running but i've no way of knowing whether this is 'my' or another instance.
0
 
LVL 96

Accepted Solution

by:
Bob Learned earned 750 total points
ID: 16639132
That, my friend, is a very good point.  I believe that it would be darn near impossible to determine that.  There would need to be an association between the two processes.

If you use WMI and examine the Win32_Process instances, they have a ParentProcessID.  It might be possible to determine which MMC instance was spawned from MSINFO32, but I am not sure what you could do with that information.

Bob
0
 
LVL 2

Author Comment

by:StewartJ
ID: 16639169
I think weve gone as far as we can here.  I guess I could try bypassing msinfo32 and running the mmc process directly but that is a whole new area.  Thanks for your help, anyway - youve earned the points for effort even if we didnt get to a result.
0
 
LVL 2

Author Comment

by:StewartJ
ID: 16646328
One further thought for an approach which I haven't had time to explore :

WaitForSingleObject to be absolutely sure that MSINfo has exited then, when it instantiates, mmc (almost certainly) will be the top window.  There is an api call (I forget which) to get that handle and, from this, I can get the process id and main thread.

This is not top of my priority list but I'll give it a try when I can.
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Screencast - Getting to Know the Pipeline
Suggested Courses
Course of the Month21 days, 1 hour left to enroll

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question