Added support for Windows using jenshnielsen's trick.