Program Run As Service "SYSTEM"

Hey everyone, I am working on a program for an Internet Cafe. I want the program to be able to run as a Service under Windows. I would like the service's "User Name" to run as "SYSTEM" instead of the current logged on user. I have tried modifying the registry values but I have failed miserably; not to mention the program ends after about 30 seconds of starting Windows. The method/answer posted here should be practical for installation of my program. If possible, I would also like to make the program uncloseable, like certain Norton programs (NPROTECT.exe). When ending this Norton application, it gives the error "The operation could not be completed. Access is denied." Or... something like various Windows components (Example: csrss.exe) which say "This is a critical system process. Task Manager cannot end this process."

Thanks for the help, I will accept either of those two types of answers, (Unclosable Task) or (SYSTEM Service).

Cheers,
Chuckie Ice
Smiley2003Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

mugman21Commented:
Honestly,

I think you would be better off creating the service using Real Basic (from realsoftware.com). Real Basic is very very simular to Visual basic, except it can produce different project types (and also for multiple OS's). Visual Basic alone is not an apporpriate language to create services with. There are several work-arounds out there, but none are robust enough.


If you don't wana use Real Basic, borland's Delphi also can create decent service apps..

Mugman
Zamba1Commented:
I concur with mugman21 in this case. VB6 is not appropriate to create services. You may be able to arrange it to get it running, but I do not recommend it in any case.

Instead of VB6 you could also use .net (VB.NET or C#) to create your service application, which is a relatively easy task there.

Zamba
Smiley2003Author Commented:
Hey mugman and Zamba, thanks for the suggestions. However, since I have already designed and just about fully completed this project, is there any *work-arounds* that anyone knows of? I suppose if there isn't, I could go back and redo the project in another language, but thats not my current mindset yet.

Cheers,
Chuckie Ice
Your Guide to Achieving IT Business Success

The IT Service Excellence Tool Kit has best practices to keep your clients happy and business booming. Inside, you’ll find everything you need to increase client satisfaction and retention, become more competitive, and increase your overall success.

Zamba1Commented:
To make it clear: Of course it IS possible to create an NT service using VB6. This is not a work-around. But beware of stability and performance issues.

As your project is in an almost completed state, see the following links that describe how to make the service and give useful advices:

http://www.vbrad.com/pf.asp?p=source/tip_service_vb.htm,
http://www.smsoft.ru/en/ntservice.htm
http://www.freevbcode.com/ShowCode.Asp?ID=4317
http://weblogs.asp.net/jdanforth/archive/2004/04/16/114493.aspx

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
mugman21Commented:
Smiley2003,

Even though you closed this question, I would like to add one point. When I recommended Real Basic, even though that version is different from MS Visual Basic, the language syntax is almost exactly the same(for programming issues, they refer people to the MSDN, that is how close it is to VB6). You wouldn't have to learn a new language, just learn the tiny little differences between Real Basic's IDE and Visual Basic's IDE. 99.9% of your existing code would not have to be changed at all. With Real Basic, the only differences code wise is with the MID keyword, but Real Basic provides a porting utility to handle things like that (porting utility is VB6 to Real B.).

Regardless of this questions status, I and Zamba would recommend you not use VB6. With Real Basic, you wouldn't have to re-write anything.

Good Luck anyhow.

Mugman
Smiley2003Author Commented:
Thank you Mugman, I will look into that. I do believe I have used Real Basic before, and as you mentioned the syntax is close/exactly the same. Thanks for both of your posts.

Cheers,
Chuckie Ice

(aka Smiley2003)
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.