title: How to change the log and startup script path in PM2 for windows
body: <p>I have a node application and I am using  <a href="https://www.npmjs.com/package/pm2" rel="nofollow noreferrer">PM2</a>  to run the application.By this i have achieved to run the app without the Active command prompt.</p>
  
  <p>Now i am trying to run the same when windows restart, so for windows I have found PM2 will not work and it needs another module <a href="https://www.npmjs.com/package/pm2-windows-startup" rel="nofollow noreferrer">PM2-Windows-startup</a> so I have used and it is working fine in my local machine.</p>
  
  <p>But when I am trying the same in server machine then which have many machines in cluster, the PM2 logs has changed its default path from <em>C:\users\admin.pm2\logs</em> to <em>H:\logs</em> and the startup script also generated in the H:\ when giving this command <code>PM2 save</code> so whenever server machine restarted also the startup script is not running results the app going down.</p>
  
  <p>How can i change the path for logs and startup script in PM2 for windows machine.How to give the <strong><em>PM2_Home</em></strong> env variable for PM2 and PM2-windows-startup</p>
  
  <p>I have tried <a href="https://www.npmjs.com/package/pm2-windows-service" rel="nofollow noreferrer">PM2-windows-service</a> following <a href="http://pm2.keymetrics.io/docs/usage/startup/" rel="nofollow noreferrer">image of steps</a> in one of comments,then it shown installed and when i check <code>PM2 list</code> no app is running.</p>
  
  <p>This is the image i found in commants in that page<a href="http://pm2.keymetrics.io/docs/usage/startup/" rel="nofollow noreferrer">image of steps</a>
  <a href="https://i.stack.imgur.com/PV3OU.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/PV3OU.png" alt="Image from PM2 site comments"></a>
    Show  my result image below
  <a href="https://i.stack.imgur.com/v2wqi.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/v2wqi.png" alt="My result image"></a></p>