Solved

can we create services?

Posted on 2004-08-09
7
535 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
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 

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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

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…
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…

813 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

13 Experts available now in Live!

Get 1:1 Help Now