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,734
  • 5
  • 21
  • 39

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
  • 53,940
  • 10
  • 58
  • 91
1

Type the following into a batch file:

cd /d "D:\Projects\scripts\"
node index.js --debug
Stephan
  • 53,940
  • 10
  • 58
  • 91
David Yee
  • 3,515
  • 25
  • 45