WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Start Menu - TaskBar

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

How to run Winbatch once each time the system is restarted

Keywords: 	  RunServices

Question:

How do I run Winbatch once each time the system is restarted?

Answer:

The 'startup' folder and the 'Run' key in the registry are not sufficient because progs being started via these methods get started everytime somebody does a logon on the computer. Since it is possible to have several users logon and then logout on a computer between reboots these methods will not meet your requirements.

On Win9x computers you can have a program run via the 'RunServices' registry key. This works in the same way that the 'Run' key is processed.

This is done under the "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion" key. In the subkey "RunServices" you create string values, with the name of the string value identifying what it is and the value determining what program is to be run and what its command line parameters are, too.

On WinNT computer with Winbatch 2001A or later, search in this DB for article ID: W13494, to run Winbatch as a service.

On WinNT computers with older version of Winbatch prior to 2001A, you will have to get the SRVANY utility from the WinNT Res Kit and use it to launch your WinBatch script as a service. Please note that if your script terminates the SRVANY program will still report that your service is running when viewed in the control panel. It will be necessary for your script to make use of the NT network extender to shut the service down properly once it is done running. You may need to use some IntControl() function calls to allow your script to be terminated during service shutdown w/o trying to interact with the desktop, e.g. terminate messages, etc...

You can then have your compiled script do whatever needs to be done at system boot time and then exit when done.


Article ID:   W14304
Filename:   Run WB each Time System is Restarted.txt
File Created: 2002:04:05:13:34:22
Last Updated: 2002:04:05:13:34:22