I have registered a custom service called customService
with Automatic (Delayed Start) as its Startup Type option. It was created using NSSM with the following command
nssm install customService
It runs a simple batch file, customService.bat
containing two simple windows command
cd D:\To\Custom\Path
type NUL > 1.txt
What the service does is run this batch file which would create an empty text file, 1.txt in \To\Custom\Path folder.
Problem
When I shutdown and boot up my machine, no 1.txt is created. However, in services.msc, it shows customService
status as Running. Why is this happening?
What I have discovered
- When the problem occurs, in Event Logs > Windows logs > Application, there is no error produced. The last recorded log is from
MSSQLSERVER
service with the Level of Information and Event ID of 8128. It has been exactly 15 minutes passed. - In
services.msc
>customService
Status shows Running. When I right-click it, I'm allowed at least 3 options: Stop, Pause, and Restart. The service runs successfully (i.e., 1.txt created) when I clickedRestart
. - In
services.msc
>customService
properties > Dependencies tab, it shows no Dependencies - I have absolutely no problems when I restart my computer ( i.e., 1.txt is created.)
Windows Specs
I have Windows 10 Version 1607 (OS Build 14393.576)
as shown when running winver
command. Also, I have all updates installed.