Win pipe

Fix issue #245, replacement of  #251