0

I have 2 directories on my windows.

  1. C:/jenkins/workspace

  2. D:/Projects/scripts/ (index.js file is in this directory)

Now, I want to execute command node index.js --debug. I want to execute this command from C:/jenkins/workspace without navigating to D:/Projects/scripts/

How can I do this?

rohitkadam19
  • 1,534
  • 4
  • 19
  • 38

2 Answers2

3
"D:/Projects/scripts/node" index.js --debug

the " are not really needed in this case, but it's a good habit tu use them, because they prevent from failures, if the path or filename contains spaces.

Stephan
  • 47,723
  • 10
  • 50
  • 81
1

Type the following into a batch file:

cd /d "D:\Projects\scripts\"
node index.js --debug
Stephan
  • 47,723
  • 10
  • 50
  • 81
David Yee
  • 3,285
  • 20
  • 41