Updated server function to work with both cygwin and msys.