Solved

can we create services?

Posted on 2004-08-09
7
533 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
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 

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 150 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

Get up to 2TB FREE CLOUD per backup license!

An exclusive Black Friday offer just for Expert Exchange audience! Buy any of our top-rated backup solutions & get up to 2TB free cloud per system! Perform local & cloud backup in the same step, and restore instantly—anytime, anywhere. Grab this deal now before it disappears!

Join & Write a Comment

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…
A safe way to clean winsxs folder from your windows server 2008 R2 editions
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

760 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now