# How To Start & Run Any Batch File (\*.BAT) As A Windows Service With AlwaysUp

**URL:** <https://onehack.st/t/how-to-start-run-any-batch-file-bat-as-a-windows-service-with-alwaysup/161931>\
**Category:** Tutorials & Methods\
**Tags:** tools, windows, file-management\
**Created:** [November 9, 2020, 1:44pm UTC](https://onehack.st/t/how-to-start-run-any-batch-file-bat-as-a-windows-service-with-alwaysup/161931 "2020-11-09T13:44:45Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![NoBody](https://onehack.st/user_avatar/onehack.st/nobody/32/163880_2.png) [@NoBody](https://onehack.st/u/NoBody)\
**Post date:** [November 9, 2020, 1:44pm UTC](https://onehack.st/t/how-to-start-run-any-batch-file-bat-as-a-windows-service-with-alwaysup/161931/1 "2020-11-09T13:44:45Z")

</div>

## Kick off your batch file when your PC boots. Automatically restart it when it stops.

To set up a batch file to run as a Windows Service with AlwaysUp:

1. [Download](https://mega.nz/file/yKozlCRI#pfL0dz-YwnzqccRUs5Ht47C6KISGJntNrNpfmRvLujY) and install AlwaysUp, if necessary.
2. Start AlwaysUp.
3. Select **Application \> Add** to open the **Add Application** window:

 ![image](https://onehack.st/uploads/default/original/3X/3/0/301616512d8a474e25be47c3e005b90e536fc1cc.jpeg)

1. On the **General** tab:

- In the **Application** field, enter the full path to the batch file. We have chosen our sample batch file, **C:\BatchFile\RunNotepad.bat** , which contains the following instructions (to launch the Notepad application):

C: CD \Windows .\notepad.exe

- In the **Name** field, enter the name that you will call the batch file application in AlwaysUp. We have used **My Batch File** but you can specify virtually anything you like.

 ![image](https://onehack.st/uploads/default/original/3X/2/9/2945799e26392d9b400875b2d7126d47aa3b471e.png)

1. If your batch file calls a program that needs access to its registry settings, etc., then you will want to click over to the **LogOn** tab and enter the user name and password of the account that can run the software normally.

 ![image](https://onehack.st/uploads/default/original/3X/0/7/07c53dc43b85c74973972fa91dfc950683bb252e.png)

1. Click the **Save** button. In a couple of seconds, an application called **My Batch File** will show up in the AlwaysUp window. It is not yet running though.

 ![image](https://onehack.st/uploads/default/original/3X/e/7/e730703d8bc454360f6139db322be6285ce50aca.png)

1. To start the batch file, choose **Application \> Start “My Batch File”**.

 ![image](https://onehack.st/uploads/default/original/3X/7/0/704f4a2160ad0c40f455286f56692c12299f0c99.jpeg)

The batch file is currently running in Session 0. On Windows XP and Server 2003, we can see it by logging on to that session. On Windows 8/7/Vista and Server 2012/2008, we can see it if we go to the isolated Session 0 by selecting **Tools \> Switch to Session 0** :

 ![image](https://onehack.st/uploads/default/original/3X/c/a/caa44161f1452b183c870957849f115cbdff1606.jpeg)

1. That’s it! Next time your computer boots, the batch file will be launched immediately, before anyone logs on. We encourage you to explore the many other settings that may be appropriate for your environment.

## **Batch file not working properly as a Windows Service?**

- From AlwaysUp, select **Application \> Report Activity \> Today…** to bring up a HTML report detailing the interaction between AlwaysUp and your application. The AlwaysUp Event Log Messages page explains the more obscure messages. _(Source: coretechnologies)_

**Happy learning!**
