title: Chrome App fails to communicate with native host on windows
body: <p>I have written a chrome app and a native messaging host in Java. The combo works fine on linux. However when I try to port the combo to windows the communication can not be established. The jar where the host is contained is exactly the same as the linux variant. I am using the following script (start.bat) to start the Java host:</p>
  
  <pre><code>@echo off
  java -jar "%~dp0theHost.jar"
  </code></pre>
  
  <p>The json manifest is as follows:</p>
  
  <pre><code>{
     "name": "com.service.host",
     "description": "Native messaging host",
     "path": "start.bat",
     "type": "stdio",
     "allowed_origins": [
        "chrome-extension://--the ID--/" 
     ]
  }
  </code></pre>
  
  <p>I have configured the HKEY_LOCAL_MACHINE\SOFTWARE\Google\Chrome\NativeMessagingHosts\com.service.host to the path e:\hosts\com.service.host.json
  the service.bat file together with the jar (theHost.jar) is also in the e:\hosts\ directory. 
  When trying to start the communication I get the error: Error when communicating with the native messaging host.
  I also tried to change the path in the manifest to: <code>e:\\hosts\\start.bat</code>
  but the result/error is the same.
  When I start the bat file manually in the cmd window the host initializes properly as far as I can tell and waits for the message from the Chrome app. Also, when I added the line:</p>
  
  <pre><code>copy NUL empty.txt
  </code></pre>
  
  <p>before the "java - jar..." line to create an empty file when the bat is invoked, the empty file is created when the bat is started manually and is not created when "invoked" by the chrome app.
  Any help would be greatly appreciated.</p>
  
  <p>Versions:
  Windows 7, Java 7u55, Chrome 34.0.1847.116 m </p>