Google Answers Logo
View Question
 
Q: Send alert when application is launched. ( No Answer,   4 Comments )
Question  
Subject: Send alert when application is launched.
Category: Computers > Operating Systems
Asked by: rden-ga
List Price: $5.00
Posted: 31 May 2005 08:18 PDT
Expires: 30 Jun 2005 08:18 PDT
Question ID: 527712
I would like to send an alert from computer A (XP) to computer B (XP)
on the same network when a specific application is launched on
computer A. It can done via a program or script that runs at startup
on computer A. It must run hidden.

I was thinking of running via "net send" command etc. I just need to
know how to trigger the net send automatically when the exe. is run on
computer A.

Another plus would be; that the alert arrives at computer B without
any indication that it is coming from computer A. Hence, "net send"
header does indicate which computer is sending the message.
Answer  
There is no answer at this time.

Comments  
Subject: Re: Send alert when application is launched.
From: flajason-ga on 31 May 2005 08:51 PDT
 
If you want to run a hidden program or script on Computer A, it really
won't be hidden.
A process of some sort will show up in the task manager. If that
person knows what they are doing, they may look there and discover the
program or script.
Likewise, they can check their startup programs and registry settings
and locate said program or script.

There is a way you can monitor the process list from computer B and
alert yourself with NO need to run a script or program on computer A.
You must be an administrator of computer B for this to work and I am
assuming that since they are both Windows XP, WMI is installed and
working.

Just copy and paste the below and save it as a .vbs file.
Change the first two lines to reflect the computer and program you
want to monitor.
You would run this on your machine (computer B)
It runs on an infinite loop with a 5 second pause between each check.
To kill it, you'll have to shut down or kill the wscript or cscript
process from task manager.
You can try it out with some process like explorer.exe that you KNOW
is running as a test.

'***This is provided with no warranty or gaurantee of any kind. ***'

computername = "Computer(A)"
exename = "Program.exe"

On Error Resume Next
Do until 1=2
   Set objWMIService = GetObject("winmgmts:\\" & computername & "\root\cimv2")
   Set colItems = objWMIService.ExecQuery("Select * from Win32_Process",,48)
   For Each objItem in colItems
      If objItem.Name = exename Then
         AlertMe
      End If
   Next
   WScript.Sleep 5000
Loop

Sub AlertMe
   WScript.Echo "Hey! " & computername & " is running " & exename & "!"
End Sub
Subject: Re: Send alert when application is launched.
From: rden-ga on 31 May 2005 12:25 PDT
 
Thanks, can I ask one more thing? In this part :

Sub AlertMe
   WScript.Echo "Hey! " & computername & " is running " & exename & "!"
End Sub

Instead of displaying message, can I get a prompt (with a "yes" or
"no") asking me if I want to kill a process on Computer B ?

Basically, when computer A runs a specific process, I want to be
alerted and get the option of killing a process (via the GUI) on
Computer B.

If you are an expert signed up with Google, then you should collect my payment.
Subject: Re: Send alert when application is launched.
From: flajason-ga on 31 May 2005 13:15 PDT
 
I'm not aware of a way to kill a process using WMI scripts.
I do know of an executable called PSKill that can end a remote process.
http://www.sysinternals.com/ntw2k/freeware/pskill.shtml
http://www.windowsitpro.com/Articles/Index.cfm?ArticleID=43569&DisplayTab=Article

Something like that can be used in conjuction with the script I wrote.

I noticed in the WindowsITPro article that there is also a PSList that
can list the processes on a remote machine as an alternative to the
script I provided.

I have not used any of the PS tools myself, but others I have worked
with used them with success.

I am not a GA Researcher, just a commenter, so I cannot formally
answer your question for payment. Anything posted by a commentor is
free advice. (take it for what it's worth)

I'm sure there are a lot of other alternatives to your question. I
posted just one that was in the realm of my expertise. You are always
free to close out the question at anytime or await a more detailed
answer from a GA researcher.

Regards,

flajason
Subject: Re: Send alert when application is launched.
From: rden-ga on 31 May 2005 13:41 PDT
 
Thanks for the info, I've been using pstools for a while. While I can
do many things remotely, I cannot do it automatically (running a loop
with "if" etc.) only manually. That is the reason why I can't use
pslist etc.

I assume that I should be able to call a ps command from within my WMI
script though. In fact, I believe I can even use a MS tool (kill) from
the Windows Resource CD. I just need to figure out how to call a
command from a yes/no prompt via WMI.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy