Board index » Visual Studio » How can I detect that a program is running on another computer?
|
sinfee
|
|
sinfee
|
How can I detect that a program is running on another computer?
Visual Studio308
This may not be a VB question but I don't know where else to ask. How can I detect if a given program is running on another computer on a LAN?. I have access to the other computer via a shared drive (I can access its drive in network neighborhood) and I know the program I'm looking for. What I want to know is whether or not the program is actually running (like seeing it in the Task Manager). Is this possible? Either in Windows itself or maybe I could write a VB program containing some API calls that could detect such a thing? Any suggestions? - |
| Tony
Registered User |
Tue May 25 03:57:20 CDT 2004
Re:How can I detect that a program is running on another computer?
WMI can do it Martin. Look for Win32_Process in MSDN (or on the Web)
Tony Proctor "Martin" <martinvalley@comcast.net>wrote in message QuoteThis may not be a VB question but I don't know where else to ask. - |
| Martin
Registered User |
Tue May 25 07:43:42 CDT 2004
Re:How can I detect that a program is running on another computer?
Randy Birch's VBNet has a couple of routines that almost do what I
want. His "Enumerating services on local & remote machines" does not show processes other than "services". And, the "List running processes" works only on the local machine (and does not work on WinNT). Randy - if you happen to see this message, can you tell me if there is any way to combine the features of your routines noted above that would allow one to list running processes on a remote computer? (one running XP, 2K or NT) On Mon, 24 May 2004 16:16:43 -0700, Martin <martinvalley@comcast.net> wrote: QuoteThis may not be a VB question but I don't know where else to ask. |
| Tony
Registered User |
Tue May 25 08:48:55 CDT 2004
Re:How can I detect that a program is running on another computer?
Try this
Dim oWMI As Object, oProcess As Object, sServer As String ' ** setup sServer first Set oWMI = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & sServer) For Each oProcess In oWMI.InstancesOf("Win32_Process") Debug.Print oProcess.Name Next oProcess Tony Proctor "Tony Proctor" <tony_proctor@aimtechnology_NOSPAM_.com>wrote in message QuoteWMI can do it Martin. Look for Win32_Process in MSDN (or on the Web) - |
| Martin
Registered User |
Tue May 25 09:05:08 CDT 2004
Re:How can I detect that a program is running on another computer?
Tony -
Thanks. I'm getting a "Can't create object" error at "Set oWMI =...". I've added a reference to the "Microsoft WMI Scripting V1.1 Library". I set sServer to the name of the computer I'm trying to access. What am I missing here? On Tue, 25 May 2004 14:48:55 +0100, "Tony Proctor" <tony_proctor@aimtechnology_NOSPAM_.com>wrote: QuoteTry this |
| Tony
Registered User |
Tue May 25 09:17:51 CDT 2004
Re:How can I detect that a program is running on another computer?
Not sure Martin. Sounds like something not registered on your machine. It
can't be an authorisation problem because you'd get an 'Access denied' error for that. Also, you don't need anything in your project references as this bit of quickie code just uses late-binding. Tony Proctor "Martin" <martinvalley@comcast.net>wrote in message QuoteTony - - |
| Bob
Registered User |
Tue May 25 09:20:39 CDT 2004
Re:How can I detect that a program is running on another computer?
"Martin" <martinvalley@comcast.net>wrote in message
QuoteTony - http://www.microsoft.com/downloads/details.aspx?FamilyID" rel="nofollow" target="_blank">www.microsoft.com/downloads/details.aspx=afe41f46-e213-4cbf-9c5b-fbf236e0e875&displaylang=en QuoteI've added a reference to the "Microsoft WMI Scripting V1.1 Library". -- Reply to the group so all can participate VB.Net... just say "No" - |
| Martin
Registered User |
Tue May 25 09:33:53 CDT 2004
Re:How can I detect that a program is running on another computer?
OK, it works if I query a Windows 2000 computer. It doesn't seem to
work against one running NT4 - should it? On Tue, 25 May 2004 15:17:51 +0100, "Tony Proctor" <tony_proctor@aimtechnology_NOSPAM_.com>wrote: QuoteNot sure Martin. Sounds like something not registered on your machine. It |
| Martin
Registered User |
Tue May 25 09:53:53 CDT 2004
Re:How can I detect that a program is running on another computer?
I just tried it against a Windows XP box and I get the "Access denied"
error. Can you tell me what I need to do to get past that? Thanks again. On Tue, 25 May 2004 15:17:51 +0100, "Tony Proctor" <tony_proctor@aimtechnology_NOSPAM_.com>wrote: QuoteNot sure Martin. Sounds like something not registered on your machine. It |
| Jeff
Registered User |
Tue May 25 10:20:23 CDT 2004
Re:How can I detect that a program is running on another computer?"Martin" <martinvalley@comcast.net>wrote in message QuoteOK, it works if I query a Windows 2000 computer. It doesn't seem to - |
| Bob
Registered User |
Tue May 25 10:30:41 CDT 2004
Re:How can I detect that a program is running on another computer?
"Jeff Johnson [MVP: VB]" <i.get@enough.spam>wrote in message
Quote"Martin" <martinvalley@comcast.net>wrote in message under the impression that you could access an NT4 box from another host using WMI without the target system needing to have it. The only issue I know of is having sufficient access rights. -- Reply to the group so all can participate VB.Net... just say "No" - |
| Martin
Registered User |
Tue May 25 10:53:22 CDT 2004
Re:How can I detect that a program is running on another computer?
I wish the target system did not need to have it but it looks like it
does. I downloaded the 6+MB package from MS and installed it on the NT machine. I can now query that computer just fine. I still haven't figured out how to get past the "Access denied" error on an XP unit, though. Can someone shed some light on this for me? Thanks. On Tue, 25 May 2004 08:30:41 -0700, "Bob Butler" <tiredofit@nospam.com>wrote: Quote"Jeff Johnson [MVP: VB]" <i.get@enough.spam>wrote in message |
| Bob
Registered User |
Tue May 25 11:03:19 CDT 2004
Re:How can I detect that a program is running on another computer?
"Martin" <martinvalley@comcast.net>wrote in message
QuoteI wish the target system did not need to have it but it looks like it Win2K and the few 9x and NT4 boxes in the mix must have it installed. QuoteI still haven't figured out how to get past the "Access denied" error specify a user/password that does. The way I know to do that is to use the locator object: Set oLocator = CreateObject("WbemScripting.SWbemLocator") Set oWMI = oLocator.ConnectServer(hostname, "root\cimv2", username,password) ' then do queries based on the authenticated object Set oSystem= oWMI.ExecQuery("Select * from Win32_OperatingSystem") -- Reply to the group so all can participate VB.Net... just say "No" - |
