title: Unable to run babel-node on Windows
body: <p>I would appreciate it if someone could help me figure out what is causing the error mentioned below.</p>
  
  <p>I have a test Express project with a <code>scripts</code> section in <code>package.json</code> that looks like the following:</p>
  
  <pre><code>"scripts": {
     "dev": "backpack",
     "build": "backpack build",
     "test-server": "babel-node node_modules/.bin/babel-istanbul cover node_modules/.bin/_mocha",
     "test-server-ms": "babel-node.cmd node_modules/.bin/babel-istanbul.cmd cover node_modules/.bin/_mocha.cmd"
  },
  </code></pre>
  
  <p>The <code>test-server-ms</code> script is what I am trying to execute:</p>
  
  <pre><code>babel-node.cmd node_modules/.bin/babel-istanbul.cmd cover 
        node_modules/.bin/_mocha.cmd "test/server"
  </code></pre>
  
  <p>This yields an error when parsing the <code>babel-istanbul.cmd</code> file:</p>
  
  <pre><code>(function (exports, require, module, __filename, __dirname) { @IF EXIST "%~dp0\node.exe" (
                                                                ^
  SyntaxError: Invalid or unexpected token
      at createScript (vm.js:56:10)
      at Object.runInThisContext (vm.js:97:10)
      at Module._compile (module.js:542:28)
      at Module._extensions..js (module.js:579:10)
      at Object.require.extensions.(anonymous function) [as .js] (C:\Users\hqrsingh\Development\workspaces\vscode\express-es6-starter\node_modules\babel
  -register\lib\node.js:152:7)
      at Module.load (module.js:487:32)
      at tryModuleLoad (module.js:446:12)
      at Function.Module._load (module.js:438:3)
      at Function.Module.runMain (module.js:604:10)
      at Object.&lt;anonymous&gt; (C:\Users\hqrsingh\Development\workspaces\vscode\express-es6-starter\node_modules\babel-cli\lib\_babel-node.js:154:22)
  </code></pre>
  
  <p>The error occurs when the <code>@IF</code> directive is encountered which is part of a Windows <code>.cmd</code> script in <code>node_modules\.bin\babel-istanbul.cmd</code>:</p>
  
  <pre><code>@IF EXIST "%~dp0\node.exe" (
    "%~dp0\node.exe"  "%~dp0\..\babel-istanbul\lib\cli.js" %*
  ) ELSE (
    @SETLOCAL
    @SET PATHEXT=%PATHEXT:;.JS;=;%
    node  "%~dp0\..\babel-istanbul\lib\cli.js" %*
  )
  </code></pre>
  
  <p>I am kicking all of this off within a Windows 7 Pro command shell via <code>npm</code>:</p>
  
  <pre><code> npm run-script test-server-ms test/server
  </code></pre>
  
  <p>For reference, here is the entire <code>package.json</code> file:</p>
  
  <pre><code>{
    "name": "express-es6-starter",
    "version": "2.0.0",
    "description": "A complete boilerplate for Express.js development including unit test and code coverage.",
    "main": "lib/index.js",
    "scripts": {
      "dev": "backpack",
      "build": "backpack build",
      "test-server": "babel-node node_modules/.bin/babel-istanbul cover node_modules/.bin/_mocha",
      "test-server-ms": "babel-node.cmd node_modules/.bin/babel-istanbul.cmd cover node_modules/.bin/_mocha.cmd"
    },
    "pre-commit": [
      "test-server"
    ],
    "dependencies": {
      "express": "^4.14.0"
    },
    "devDependencies": {
      "babel": "^6.23.0",
      "babel-cli": "^6.24.1",
      "babel-istanbul": "^0.12.2",
      "babel-preset-es2015": "^6.24.1",
      "babel-preset-stage-0": "^6.16.0",
      "babel-preset-stage-2": "^6.24.1",
      "backpack-core": "^0.0.7",
      "chai": "^3.5.0",
      "karma": "^1.7.0",
      "karma-chrome-launcher": "^2.1.1",
      "karma-jasmine": "^1.1.0",
      "karma-phantomjs-launcher": "^1.0.4",
      "mocha": "^3.2.0",
      "phantomjs": "^2.1.7",
      "pre-commit": "^1.2.2",
      "webpack": "^1.14.0"
    }
  }
  </code></pre>