Node.js is getting more popular by the day. It breaks JavaScript free from the browser. I would love to auto start an application Рmuch like a Windows service Рwithout keeping a console window open. There are many programs / services to wrap node applications into an executable, but I like to stick with just Node. This small trick will start your Node application windowless on Windows.

VBS to the rescue

I’ve created a small Visual Basic Script called app.vbs¬†that will start your node application within a hidden window:

The little zero at the end does the trick. The string is the command to start the node process with the app.js. The .vbs extension is executable in Windows.


To execute it automatically at startup, open the %AppData%\Microsoft\Windows\Start Menu\Programs\Startup\ directory and add a shortcut to the app.vbs file.

Proof of concept

So let’s build a small app to proof that it works. The following script¬†will create a web server and log all the requests to a debug file. We’ll stream the file back.¬†The¬†/clear will clear the log file. The¬†/kill will stop the app – this is very important, because the app will be started without a window. This will give us an easy way to shut it down.

Try it out!

Don’t forget to execute a npm install express to install the web server! Always make sure that the¬†node app.js works. The¬†.vbs will not create a window, so you won’t see if it crashes.

  1. Execute the app.vbs. This will create a process:
    Node.exe is now visible in the Task Manager
  2. Open up the app in your browser http://localhost:5000¬†and you’ll see:
    The server streams the debug logging back.
  3. Play around with it and kill the application with¬†http://localhost:5000/kill. This request stops the node application. You’ll see that it is no longer present in the task manager.


So, that’s it. Pretty easy. Remember: this only works under Windows! Also remember: windowless applications can’t be terminated using the CTRL+C command. Killing the process in the task manager will.