This is just a guess at what might be wrong; I haven't tried it. I'm thinking it may be that Windows doesn't like the "\n" on the end of your command
string. Newline in Windows is "\r\n".
To fix, either just try that as the rest of your code is tied to Windows anyway or, in the interest of portability
, use bw.newLine() or swap your BufferedWriter for a PrintWriter and use println().
Jules