Network Administrator Knowledgebase

Oct 31 2008   12:18AM GMT

Run a Batch File Before Logging on to Computer

Michael Khanin Michael Khanin Profile: Michael Khanin

Windows 2000 or Windows XP can be configured to run a startup script that is a batch file, VB script or JScript by using Group Policies. As well we can use AutoExnt utility, from the Resource Kit.

The AutoExNT service permits an administrator to configure a Windows based computer to run a custom batch file when first starting the computer. Also, a user or administrator is not required to be logged on at the time this custom batch file runs.

To start using  AutoExNTdo the following steps:

Installing the AutoExNT Service

  1. Using a text editor (such as Notepad), create a batch file named Autoexnt.bat and include the commands you want to run at startup in this file.
  2. Copy the Autoexnt.bat file you just created, in addition to the Autoexnt.exe, Servmess.dll, and Instexnt.exe files located in the Resource Kit CD-ROM to the %SystemRoot%\System32 folder on your computer.
  3. At a command prompt, type instexnt install, and then press ENTER.

You should then receive the following message:

CreateService AutoExNT SUCCESS with InterActive Flag turned OFF

To view the installation processes running on the desktop, you must install the AutoExNT service using the /interactive switch. For example, instead of typing instexnt install, you would type instexnt install /interactive at a command prompt, and then press ENTER.

Testing the AutoExNT Service
To test the AutoExNT service, log on to your computer with an account that has administrator credentials, type net start autoexnt at a command prompt, and then press ENTER. The Autoexnt.bat file should run in an MS-DOS window.

NOTE: The AutoExNT service includes a /interactive switch, analogous to the /interactive switch of the AT command. This switch permits you to view the status of processes as they run. Because no user environment variables have yet been declared when AutoExNT runs at system startup, you must use full path names.

Also, if you need a service to be running before you start running a dependent process, you may include a command to start this service at the beginning of your Autoexnt.bat file. For example, if your batch file has commands that require the Server service to be running, include a net start server command at the beginning of your Autoexnt.bat file.

Configuring the AutoExNT Service to Run at Startup
To configure the AutoExNT service to run at startup:

  1. Click Start, point to Programs, point to Administrative Tools, and then click Computer Management.
  2. Double-click the Services and Applications branch to expand it, and then click Services.
  3. Double-click the AutoExNT service, click Automatic in the Startup type box, and then click OK.

 Comment on this Post

There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when other members comment.

Forgot Password

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

Your password has been sent to:

Share this item with your network: