MiketheD
asked on
Windows 2003 Custom Service
All,
I'm trying to use VB.NET to monitor an application on a WK2003 Server. Basically I would like the service to determine how long that process is running and if its been running for more than 5 minutes then terminate it like you would from task manager. I only know the name of the process. Is this possibile? I have VB.NET Studio 2005.
Thanks in advance,
Mike
I'm trying to use VB.NET to monitor an application on a WK2003 Server. Basically I would like the service to determine how long that process is running and if its been running for more than 5 minutes then terminate it like you would from task manager. I only know the name of the process. Is this possibile? I have VB.NET Studio 2005.
Thanks in advance,
Mike
ASKER
3 S:,
Thanks for the fast reply... Here is the problem I want to solve... I work for a retailer that has a server and a desktop PC. In a nutshell when the user from the desktop runs a report it fires a process called grindq.exe ON the server. This process hangs quite a bit and the only way to get the reports to work again is to terminate the process. I was hoping to create a service that will monitor anytime the "grindq.exe" is launched on the server and if it runs for more than 5 mins terminate it. Hope this makes sense....
Thanks,
Mike
Thanks for the fast reply... Here is the problem I want to solve... I work for a retailer that has a server and a desktop PC. In a nutshell when the user from the desktop runs a report it fires a process called grindq.exe ON the server. This process hangs quite a bit and the only way to get the reports to work again is to terminate the process. I was hoping to create a service that will monitor anytime the "grindq.exe" is launched on the server and if it runs for more than 5 mins terminate it. Hope this makes sense....
Thanks,
Mike
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
3_S:,
The report is run from POS software of which I have limited knowledge due to the propriety nature of the system. The code to kill the process makes sense but since they run that report at various times throughout the day, is there a way to check how long a process has been running? I can then write a service that checks every so often to see if grindq.exe is resident & if it has been running longer than 5 minutes terminate it&.
Thanks,
The report is run from POS software of which I have limited knowledge due to the propriety nature of the system. The code to kill the process makes sense but since they run that report at various times throughout the day, is there a way to check how long a process has been running? I can then write a service that checks every so often to see if grindq.exe is resident & if it has been running longer than 5 minutes terminate it&.
Thanks,
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
3_S:
Thanks for the help, between your help and a bit of google I'm well on the way.
Mike
Thanks for the help, between your help and a bit of google I'm well on the way.
Mike
Is a restart required? or you just want to stop the service?
I don see the point in stopping a service that runs for 5 minutes. Can you not add the program as a scheduled task and terminate it after 5 minutes?
otherwise if it is just a process and not a service
Dim pProcess() As Process = System.Diagnostics.Process
For Each p As Process In pProcess
p.Kill()
Next
Open in new window