Basically what I want is to start an express.js server with forever on startup Windows. I've created a .cmd file with commands (see below). When I double click on this file the server starts and works like a charme. However, when I create a task in Windows 10 Task Scheduler with a trigger on "Logon User", the cmd window opens, does something (cannot see console so quickly) and closes. No server started.
This is the code in the .cmd file
cd\
cd Users\Jan
timeout /T 5
forever start forever.json
- User is administrator
- Tried a timer in the cmd file
- Tried to delay the trigger by 5 mins. in Task Scheduler
Does anyone has a clue why this works on double click file and not when opened by Task Scheduler? Is there a better way to start this server with forever?
Found the problem in the fact that the full path needs to be used in de command lines. I've checked the .json file and changed the relative paths to full paths also and now it works.
However, when I use the command
forever listforever does not show any forever processes running. Nevertheless my server is running. Thanks all!