Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

can we create services?

Posted on 2004-08-09
7
Medium Priority
?
543 Views
Last Modified: 2010-04-14
can we put our own execute file into the services (in the administator tools) to make it start automatically? will the services run the execute file automatically after the windows start? Thank you..
0
Comment
Question by:vivian1
  • 4
  • 3
7 Comments
 
LVL 34

Expert Comment

by:Dave_Dietz
ID: 11759090
Yes (depending on whether the executable is properly written to run as a service)

Yes (this is what services do....)

:-)

Dave Dietz
0
 

Author Comment

by:vivian1
ID: 11759349
Thank you for your answer, Dave.

But I need to how how to put our execute file into the services. Is it need to write some coding or just use some command to install the service? I wrote the execute file by using VB. Thanks.

vivian
0
 
LVL 34

Expert Comment

by:Dave_Dietz
ID: 11759468
See the following:

How To Create a User-Defined Service
http://support.microsoft.com/default.aspx?scid=kb;en-us;137890

This should get you going in the right direction.  :-)

Dave Dietz
0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

 

Author Comment

by:vivian1
ID: 11768983
Thank a lot..it's really help me to understand more about windows service.:)
I had try yesterday by following the instructions there. Anyway, it doesn't work.. everythg is ok at first, and i success to put in my service.
My execute file suppose to pop up a window with a button to click (form in VB). But, after I start the service, no window pop up...
and i look at the property of the service. i find out that the path to execute is C:\Reskit\srvany.exe.(the path where I put the instsrv and srvany). Is it the problem?

vivian
0
 
LVL 34

Accepted Solution

by:
Dave_Dietz earned 600 total points
ID: 11769080
The service should show srvany.exe as the executable.  Srvany takes a parameter that tells it what to execute as a service.

The problem is that a service shouldn't pop up dialog boxes unless it has been set to interact with the desktop. You can find this setting in the properties of the service.  The only problem here is that I'm not sure the setting would apply to the executable launched by srvany.

It almost sounds like this is a program you want to run when someone logs on.  Is this correct?  If so there are much better ways to accomplish what you are trying to do.  Let me know and I can go into more detail.

Dave Dietz
0
 

Author Comment

by:vivian1
ID: 11769231
Dave, you are right, after I set to interact with the desktop, it pop up the window.

Actually I used the pop up window for testing only. The thing I need to do is to write a program in VB. This program is to check database automatic for every 3 seconds right after the windows start. So i need to use it as a service.

Is it my program should write inside
Private Sub Form_Load() ? and then finally need to unload the form so that i no need to make it interact with the desktop?
Is it with the unload form will make the execute file stop and need to start again?

Thank a lot to Dave...you really help me a lot...:)

vivian
0
 
LVL 34

Expert Comment

by:Dave_Dietz
ID: 11769268
Now you're getting into VB programming and I'm afraid that a bit out of my range of expertise.

I would suggest posting a new question in the Visual Basic forum and see if one of the code gurus can help with that aspect of the issue....  :0-)

Dave Dietz
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
The first step to building an amazing About page is to figure out what you want the page to say about your company. You then must grab the attention of the reader, boast a bit, tell a story and let others brag about you. With a little bit of thought…
Integration Management Part 2
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…

971 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question