0

I have one JavaScript(.JS) file and i want to call it when system(PC) is start up.

Is it possible to call JavaScript file whenever system(PC) starts ?

Thanks

Yash
  • 191
  • 2
  • 3
  • 14

1 Answers1

1

You need an environnement to start your JS file. Let's say you use node.

Create a batch file (windows) (or sh file (unix)) with something like node YOURJSFILE.js.

Then you have to say to your OS to execute it at startup.

Example : Windows

To run a batch file at start up: start >> all programs >> right-click startup >> open >> right click batch file >> create shortcut >> drag shortcut to startup folder.

Run Batch File On Start-up

Example : Unix

How to run a shell script at startup

Community
  • 1
  • 1
antoinestv
  • 3,286
  • 2
  • 23
  • 39
  • its open .JS file in editor , like in my case its opening it in Visual Studio. I want to execute the script and not just opening it – Yash Jul 01 '15 at 17:05