Revert "Use quoting rather than shellescape to give Windows compatibility"

This reverts commit 78945e260700cda9f46078d1ba887d61fc3a4782.
Use Windows API magic to get a safe path in Windows