improvements to script towards windows support