andriscs

Hi,

I have a program that has two goals: start with Windows (XP) and always keep running until Windows shutdown. The user is a limited user of Windows XP. How can I start the program that the user won't be able to terminate it with task manager or taskkill I thought about starting my program as a Windows service (I am not aware of what can be started as a Windows service - is it possible to start a .NET form as a service ) with admin rights but I am not sure it is possible. The other idea is to handle the kill process signal in my application. Can it be handled at all I hope you can recommend me something useful.




Re: Visual C# General How to make a program unstoppable

immrtfoo

No offense but it seems like a key logger or something





Re: Visual C# General How to make a program unstoppable

Ji Cheng Wang - MSFT

Hi andriscs,

As I understand to your question, I think a windows service is suitable to your case and you can set a administrator account to start it. I'm not sure what you are going to start in a windows service. As far as I know, you'd better not start a .NET WinForm application in a windows service. If you would like to write a windows service in .NET, try to check out this MSDN document for details - http://msdn2.microsoft.com/en-us/library/9k985bc9(VS.80).aspx

If I have misunderstood you, please correct me and clarify what you are concerning. Thanks.

Regards,






Re: Visual C# General How to make a program unstoppable

andriscs

immrtfoo wrote:

No offense but it seems like a key logger or something



It has nothing to do with a keylogger.

I just need a windows form to pop up when Windows starts. I know I can add it to the Startup directory as well but it is crucial to make the form start really early and keep it running with no GUI visible except on the notification area. I just want it not to be stopped by the limited user. How can I prevent it





Re: Visual C# General How to make a program unstoppable

andriscs

Hi,

Is it possible to create a deployment package and somehow set restrictions to it and install the application to the target machine and so the limited user can't kill the application because of the restrictions That's an idea, I need confirmation of hwo viable it is.

My other idea is creating a Windows service with administrator rights, and the service will start my application exe then monitors if the ProcessExited event is fired and if it happens, it blows up the machine Which idea is more viable





Re: Visual C# General How to make a program unstoppable

AlexBB

Ji Cheng Wang - MSFT wrote:

Hi andriscs,

As I understand to your question, I think a windows service is suitable to your case and you can set a administrator account to start it. I'm not sure what you are going to start in a windows service. As far as I know, you'd better not start a .NET WinForm application in a windows service. If you would like to write a windows service in .NET, try to check out this MSDN document for details - http://msdn2.microsoft.com/en-us/library/9k985bc9(VS.80).aspx

If I have misunderstood you, please correct me and clarify what you are concerning. Thanks.

Regards,

Sounds like the guy is in the business of writing spyware: highjacker or a trojan. Your help may end up in just another virus we will have to extract from our computers.






Re: Visual C# General How to make a program unstoppable

andriscs

AlexBB wrote:
Ji Cheng Wang - MSFT wrote:

Hi andriscs,

As I understand to your question, I think a windows service is suitable to your case and you can set a administrator account to start it. I'm not sure what you are going to start in a windows service. As far as I know, you'd better not start a .NET WinForm application in a windows service. If you would like to write a windows service in .NET, try to check out this MSDN document for details - http://msdn2.microsoft.com/en-us/library/9k985bc9(VS.80).aspx

If I have misunderstood you, please correct me and clarify what you are concerning. Thanks.

Regards,

Sounds like the guy is in the business of writing spyware: highjacker or a trojan. Your help may end up in just another virus we will have to extract from our computers.



What's wrong with you all This program is a countdown application. When the time is up, it displays a messagebox. How could it count down, if it is terminated Spyware Trojan With C# Don't make me laugh, if I wanted to make things like that I'd ask a professional who'd use assembly or native C. The assumption is insulting...





Re: Visual C# General How to make a program unstoppable

AlexBB

andriscs wrote:
AlexBB wrote:



What's wrong with you all This program is a countdown application. When the time is up, it displays a messagebox. How could it count down, if it is terminated Spyware Trojan With C# Don't make me laugh, if I wanted to make things like that I'd ask a professional who'd use assembly or native C. The assumption is insulting...

OK, let's continue discussion if you wish. What is wrong with just telling a user that the application should not be shut down What if your messageBox is replaced with a cute form ShowDialog () where a warning is displayed along with the message: "Please Do Not Shut Down." If you've got users who will do it anyway, you should not post here on the subject, period. They are either nuts or they would think you are. I think for a user to have something unauthorised and out of control running on his machine is insulting. It makes me feel creepy when I discover something like this. And it has happened time and again. Are your users mentally retarded or what

Make me wrong. I will listen.

Thanks.






Re: Visual C# General How to make a program unstoppable

andriscs

You do not know a circumstance: these computers do not belong to those users. These are public computers used by anyone. As I own those machines, I have the rigth to limit the rigths of the users. The program keeps the order: the machine can be used only for limited time, and my program shows the remaining time. If time is up, the user is not authorized to use the computer any longer. If the user kills the counting program what will keep it from using the machine beyond the limited time I hope this makes things clear.





Re: Visual C# General How to make a program unstoppable

Peter Ritchie

You can't entirely make a program unstoppable; but you can make it more difficult. You can revoke TERMINATE_PROCESS access right from a specific user or group (like Everyone); but it's really complex. I've never done it in .NET. You'd have to PInvoke many functions.






Re: Visual C# General How to make a program unstoppable

andriscs

Isn't is less difficult to create a service that contains a Process object, and when the ProcessExited event is fired, it calls ExitWindowsEx It doesn't seem too complex but as I have never created and used Windows service, I don't know if it can create a Process object and make it run.





Re: Visual C# General How to make a program unstoppable

Peter Ritchie

andriscs wrote:
Isn't is less difficult to create a service that contains a Process object, and when the ProcessExited event is fired, it calls ExitWindowsEx It doesn't seem too complex but as I have never created and used Windows service, I don't know if it can create a Process object and make it run.
How would that make a program unstoppable

If you have control of the computer; I would just not grant any users rights to terminate any applications. They can still close applications, they just can terminate them. See you system admin if you have one.






Re: Visual C# General How to make a program unstoppable

andriscs

Well, what's the difference between closing and termination Both way ends up with the stop of my counting application. I just want to make the the user not want to terminate the application and if he does, the "punishment" is that the computer logs out. How can I disable the limited users from terminating an application

I guess, choosing the topic title to "unstoppable" makes people think that my program wants to spread and I'd like to manage to make it unstoppable while it does it. This was a bad choice, but the word "unterminable" might not exist. My english is poor, sorry for that.





Re: Visual C# General How to make a program unstoppable

Peter Ritchie

An application can always exit whenever it wants. Termination is when someone calls TerminateProcess on a process. In order to call TerminateProcess the user must have that access right. If no one has the right to call TerminateProcess, no one can terminate processes through something like kill or Task Manager. They'll still be able to press the Close button, select File/Exit, etc.






Re: Visual C# General How to make a program unstoppable

andriscs

But what if a program, that a limited user started and it freezes How can then the user kill it if his Terminate right is missing