Tip

Run your scripts without logging in

One of the great advantages to having an application that runs as a service is that you can be sure that when the system boots or reboots, the service will load without any effort on your part.

However, there are many circumstasnces where you would like something to happen at boot time that cannot normally be loaded as a service. Maybe you need to run a script or batch file, a Java application, or some other type of software that is not optimized to run as a service. What you usually end up doing in these cases is logging into the system manually, running the script or application, and then locking the workstation. If a server reboots at 3am on a Sunday, then I hope you left your pager on!

Fortunately, there is an alternative. One of the most valuable (and least publicized) tools in the Win2k Resource Kit is a little service called AutoExNT. When this service is run, it looks in the system32 directory for a batch file called autoexnt.bat. It runs this batch file, then shuts itself off. Thus, you can script virtually any activity to occur on your remote server or workstation at boot time. No manual intervention is required.

There are uses for AutoExNT in circumstances other than boot time. Since it stops itself on completion, you could set this service to manual and use it as a simple trigger for complex scripts on the remote server. Just start the service remotely and the script will run. When the service stops you can do it all over again.

    Requires Free Membership to View


This was first published in December 2001

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.