• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 624
  • Last Modified:

Coverting process for vb6.0 app to NT service

Dear experts
I am going to convert a VB 6.0 application to NT service.
I have downloaded an OCX for this purpose from following web site
but the problem is thst I can not understand the whole process that I must follow to converet it into NT service i.e after writing code (that is mentioned in the above web site)what step i should follow. What steps I should follow in this whole converting process.
you should also know that my form should be invisible as ymy service is running.
Waiting anxiously for your response.
Thanks to all genious experts.
  • 4
1 Solution
You can use SRVANY to convert a VB executable into an NT Service.
Microsoft's WinNT RESKIT includes a very useful utility that allows you to convert most DeskTop applications into a SERVICE application. This basically means that you can run an application behind the scenes i.e. it doesn't depend on a specific user to log on.
These are the steps that you should follow:

1.     Create a directory under your root and call it SRVANY and copy these three files:
SRVANY.EXE, SRVANY.WRI, and INSTSRV.EXE into the SRVANY directory.  The files come from the WinNT RESKIT.

2.     Go to the DOS Command prompt and navigate to the SRVANY Directory. At the command prompt type:
INSTSRV <service name> c:\srvany\srvany.exe

(Notice the second element on the command line " <service name> ". This is the "name" of the service that you will create. Later, you will go to the SERVICE applet in the CONTROL CENTER and will access the service by this name. Since you are creating a name, you can call it anything you want, so don't be too vague.)

3.     Exit the DOS COMMAND Console, and fire up the REGEDT32.EXE. Be careful while you are in there, don't mess with other stuff.

4.     Open up the HKEY_LOCAL_MACHINE window and double-click on the SYSTEM branch. The branch opens up and you should see the CurrentControlSet branch. Double-click on that one and the Services branch should appear. Double-click on the Services branch and a long list of branches is displayed.

5.     Scroll down until you find the name of the service that you created.

6.     Double-click on the name of your service and leave this highlighted.

7.     Move the cursor up to the EDIT menu bar and click on "Add Key..."

8.     The Add Key dialog box is displayed. In the "Key Name" text box type: Parameters

9.     Highlight the Parameters Key and bring your cursor to the EDIT menu bar again and click on the Add Value choice.

10.     In the "Value Name" text box type in: Application
From the "Data Type" list box choose: REG_SZ
Now press OK

11.     The String Editor Dialog box will open up. Enter the full path to your program's executable.
For example:  c:\MyApp\Sample.exe
Press OK .

12.     Highlight the Parameters Key and once again bring your cursor to the EDIT menu bar again and click on the Add Value choice to add another key.

In the "Value Name" text box type in: AppParameters
From the "Data Type" list box choose: REG_SZ and press OK

13.     When the String Editor dialog box opens up add and opening parameters that your program needs in order to run.  If none are needed, you can skip this step.
Close it all up and exit the REGEDT32 program. Now you can breathe easy again. The worst is over. Move to the Control Panel.

14.     Open up the SERVICE Applet and scroll to the name of your service line and double click on it.

A dialog box opens up. Choose the Startup Type: Automatic (for unattended operation, this will allow your service to be active when there is no one logged on).  If you want this service to run under a specific account,oOn the “Log On” tab, click on “This Account”, then Browse. Highlight the account name and click OK.

15.     Click on OK on the service property box and exit the services.

16.     Reboot the machine.
habibbAuthor Commented:
Dear EstebanFG
Thanks for your easy steps I shall increase points upto 5 if I succeeded.
thanks again
habibbAuthor Commented:
EstebanFG I have follow your Instructions and succeeded but I am facing some problems. when i press start button (on the serevice applet in control pannel) it display following error message:
Could not start 'Myservicename' service on \\Mycomputername
error 2186 the service is not responding to the control function.
moreover it does not run  even no user is login.
I hope you will understnad my problems.
I am waiting for your Quick response. thanks
Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

habibbAuthor Commented:
wakeup EstebanFG and help me.
ADMINISTRATION WILL BE CONTACTING YOU SHORTLY.  Moderators Computer101, Netminder or Mindphaser will return to finalize these if they are still open in 7 days.  Experts, please post closing recommendations before that time.

Below are your open questions as of today.  Questions which have been inactive for 21 days or longer are considered to be abandoned and for those, your options are:
1. Accept a Comment As Answer (use the button next to the Expert's name).
2. Close the question if the information was not useful to you, but may help others. You must tell the participants why you wish to do this, and allow for Expert response.  This choice will include a refund to you, and will move this question to our PAQ (Previously Asked Question) database.  If you found information outside this question thread, please add it.
3. Ask Community Support to help split points between participating experts, or just comment here with details and we'll respond with the process.
4. Delete the question (if it has no potential value for others).
   --> Post comments for expert of your intention to delete and why
   --> YOU CANNOT DELETE A QUESTION with comments; special handling by a Moderator is required.

For special handling needs, please post a zero point question in the link below and include the URL (question QID/link) that it regards with details.
Please click this link for Help Desk, Guidelines/Member Agreement and the Question/Answer process.  http://www.experts-exchange.com/jsp/cmtyHelpDesk.jsp

Click you Member Profile to view your question history and please keep them updated. If you are a KnowledgePro user, use the Power Search option to find them.  

Questions which are LOCKED with a Proposed Answer but do not help you, should be rejected with comments added.  When you grade the question less than an A, please comment as to why.  This helps all involved, as well as others who may access this item in the future.  PLEASE DO NOT AWARD POINTS TO ME.

To view your open questions, please click the following link(s) and keep them all current with updates.

*****  E X P E R T S    P L E A S E  ******  Leave your closing recommendations.
If you are interested in the cleanup effort, please click this link
POINTS FOR EXPERTS awaiting comments are listed in the link below
Moderators will finalize this question if in @7 days Asker has not responded.  This will be moved to the PAQ (Previously Asked Questions) at zero points, deleted or awarded.
Thanks everyone.
Moderator @ Experts Exchange
habibbAuthor Commented:
Problem in provided solutions. Not exact solution
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now