Computing.Net > Forums > Windows NT > Start a program from a service

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Start a program from a service

Reply to Message Icon

Name: greavsie
Date: June 19, 2000 at 00:22:49 Pacific
Comment:

Does anybody know how to start a program by using a service

Thanks

Simon



Sponsored Link
Ads by Google

Response Number 1
Name: jdoc
Date: June 19, 2000 at 12:21:00 Pacific
Reply:

The following is from the Windows NT Resource kit. It discusses how to set up a batch file that you can run as a service. I have found it to be very useful.

I set mine up as a system accounts. If you don't want to see the batch file execute (open a DOS window) then make sure to uncheck the option to "Allow Service to interact with Desktop"


Notes for the AutoExNT Service, Version 1.2
=================================================

The AutoExNT service allows you to start a batch file, AUTOEXNT.BAT, at boot time without having to log on the computer on which it will run.

To use AutoExNT, you must be running Windows NT 3.5 or later. It includes a "/interactive" option, analogous to the /interactive option of the AT command, which allows you to see the processes started.


Files
========
The AutoExNT service requires the following files:
AUTOEXNT.EXE The AutoExNT service routine. Copy this into your %systemroot%/system32 directory.
AUTOEXNT.TXT This Readme
INSTEXNT.EXE Use this to install the service.
SERVMESS.DLL The AutoExNT message DLL. Copy this into your %systemroot%/system32 directory.


Usage
========
- First copy the AUTOEXNT.exe and the SERVMESS.DLL into the %systemroot%/system32 directory.
- Now create an AUTOEXNT.BAT file with the needed commands and copy this one also into the %systemroot%/system32 directory.

NOTE: Don't forget that there are no user-environment variables at boot time, so use full pathnames etc. Also, if you are relying on a service (for example, server or schedule) you might want to add a NET START "service" in the beginning of your AUTOEXNT.BAT batch file to make sure that these services are running before you execute your dependent process. This is needed since at boot time, there is no guarantee that all processes will be up and running when AutoExNT is executed.

- At a command prompt, type:
INSTEXNT install
When everything is fine, the application responses:
>> CreateService AutoExNT SUCCESS
with InterActive Flag turned OFF.

- You may also type at this prompt:
INSTEXNT install /interactive.
In this case, you can see the processes running on the desktop. However, users (logged on locally) are able to stop them.

When everything is fine, the application responds:
>> CreateService AutoExNT SUCCESS
with InterActive Flag turned ON.


To test the service.
========================
Log in as an administrator and enter the following command:

net start autoexnt

You will see a new Commandbox running the AUTOEXNT.BAT file.

To install for autostart at boottime:
======================================
- Choose Control Panel | Services.
- Select AutoExNT
- Select Startup
- Select Startup Type: Automatic
- When you need rights outside your local system (for example to perform a NET USE command):
Select "Logon As: This Account."
Specify an account which has sufficient privileges on your domain/system, and give/confirm the password.
- Choose OK.

Your AutoExNT service is now installed.


Good luck. jdoc.


0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Windows NT Forum Home


Sponsored links

Ads by Google


Results for: Start a program from a service

unable to setup/install programs from drive D www.computing.net/answers/windows-nt/unable-to-setupinstall-programs-from-drive-d/6123.html

Launching a program as a service www.computing.net/answers/windows-nt/launching-a-program-as-a-service/18743.html

starting & stopping a service www.computing.net/answers/windows-nt/starting-amp-stopping-a-service/3143.html