On Windows, the PWD environment variable does not exist and cannot be imported in scripting mode, so it is set explicitly. Reviewed-by: lagergren, sundar