Compatibility with windows

Add compatibility with windows.
Tested on windows server 2012 R2. Not tested on Unix.