Using a batch file to start pm2 when windows starts?
问题 I can't get pm2 to start my apps on Windows start. I'm running Windows Server 2012 R2 Standard and pm2 2.4.2 . I have a pm2 process file in JSON format which I use to start all my apps. c:\pm2\process.json { "apps": [ { "name" : "my-app", "script" : "c:\\node\\myapp\index.js" } ] } I have a batch file which uses the JSON file: c:\pm2\pm2-startup.bat @echo off set HOMEDRIVE=C: set PM2_HOME=C:\etc\.pm2 setx /M PM2_HOME C:\etc\.pm2 cd C:\pm2 & pm2 start process.json I have a Windows task