Hi everyone, I have a problem, we borrow our clients laptops in our company for a short time. Users should be the local admin of the computer in order to add/remove programs they need. However, some of them didn't return the laptops in time so, we decided to write a program that locks the computer on date that we give before. I have one windows service, one form application which interacts with user and communicates with the service. While I testing, when I kill my program or my service, I give bsod but, when I try to disable the service and restart my computer, it doesn't run anymore. I need a method to prevent disable my service. Even my form application gets killed, my service has to run in background. Thanks.
we borrow our clients laptops in our company for a short time
Presumably you mean that you lend them to your clients.
we decided to write a program that locks the computer on date that we give
Seems like an unlikely and complicated solution. Why don't you just send them a bill, with an appropriate markup, as the replacement cost of the computer? The markup should be high enough that it allows you to buy a new computer and cover collection agency costs. Presumably the clients are in fact capabable of covering that cost or you shouldn't be lending it to them in the first place.
I need a method to prevent disable my service
I am rather certain that is impossible. You can however make it difficult.
But really will this fix your problem? Are you sure the clients will return the computer then? What stops them from just throwing it in the trash?
I'd boot in safe mode and install my own "fun.exe" before returning it to you
While there's few valid reasons to be late in returning the laptop, there's none in locking it. You have a list of people whom you lent it to; send them a mail and charge them a small fee for each day that it's not returned.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]