0

As of now I have a .bat file in the Startup folder which runs the command

START cmd.exe /k "cd C:\restAPI & node server.js"

This works perfectly but, because I am running this on Windows Server 2012 I was wondering if there is a better way to do this. Preferably run it in a way where the user could not accidentally close the cmd window.

Yung Lean
  • 1
  • 4
  • Sure, create a service and have it start automatically. you can even add in auto recovery so if it exits with an error status code it'l auto restart. – Kevin B Jul 08 '15 at 15:03
  • That's exactly what the Startup folder is for. There's also Task Scheduler. But all options are equally effective IMO. More effective how really? – laggingreflex Jul 08 '15 at 15:08
  • @laggingreflex I was looking for a way where the user would not be able to accidentally close the cmd window. – Yung Lean Jul 08 '15 at 15:11
  • @KevinB I will give that a try! – Yung Lean Jul 08 '15 at 15:11
  • I use nssm for creating windows services. No idea if it's the best option out there, but it works for me. – Kevin B Jul 08 '15 at 15:15
  • Using Task Scheduler you can create a task that runs in [the background.](http://google.com/search?q=task+scheduler+background). It doesn't show any window – laggingreflex Jul 08 '15 at 15:17

0 Answers0