Solved

can we create services?

Posted on 2004-08-09
7
537 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
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 

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

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Windows 2000 undelete (free program?) 6 437
Closing cmd window after script execution 4 419
Windows Foriegn Disk 3 140
testing the trust relationship between two domain 1 98
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…
Enabling the Skype for Business Meeting Scheduler in Hybrid OWA
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

685 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