diff --git a/contrib/src/argon2/argon2-uwp.patch b/contrib/src/argon2/argon2-uwp.patch
index 546ef0244ca13188de1d4ceb8ab2138972291c80..fd2fc6135e0dd67857b5ff2e2fee1043ef233813 100644
--- a/contrib/src/argon2/argon2-uwp.patch
+++ b/contrib/src/argon2/argon2-uwp.patch
@@ -62,7 +62,31 @@
      <WholeProgramOptimization>true</WholeProgramOptimization>
      <CharacterSet>MultiByte</CharacterSet>
    </PropertyGroup>
-@@ -179,6 +179,7 @@
+@@ -132,6 +132,7 @@
+       <Optimization>Disabled</Optimization>
+       <SDLCheck>true</SDLCheck>
+       <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
++      <AdditionalIncludeDirectories>$(ProjectDir)..\..\include</AdditionalIncludeDirectories>
+     </ClCompile>
+   </ItemDefinitionGroup>
+   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+@@ -140,6 +141,7 @@
+       <Optimization>Disabled</Optimization>
+       <SDLCheck>true</SDLCheck>
+       <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
++      <AdditionalIncludeDirectories>$(ProjectDir)..\..\include</AdditionalIncludeDirectories>
+     </ClCompile>
+   </ItemDefinitionGroup>
+   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+@@ -150,6 +152,7 @@
+       <IntrinsicFunctions>true</IntrinsicFunctions>
+       <SDLCheck>true</SDLCheck>
+       <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
++      <AdditionalIncludeDirectories>$(ProjectDir)..\..\include</AdditionalIncludeDirectories>
+     </ClCompile>
+     <Link>
+       <EnableCOMDATFolding>true</EnableCOMDATFolding>
+@@ -179,6 +182,7 @@
        <IntrinsicFunctions>true</IntrinsicFunctions>
        <SDLCheck>true</SDLCheck>
        <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -70,7 +94,6 @@
      </ClCompile>
      <Link>
        <EnableCOMDATFolding>true</EnableCOMDATFolding>
-\ No newline at end of file
 -- 
 2.10.2.windows.1
 
diff --git a/contrib/src/pcre/fetch_and_patch.bat b/contrib/src/pcre/fetch_and_patch.bat
index df896cd5dab33ed37668ed4d82eb36d29162c092..b71731170057baa6b0cba28aebd4567bc352b435 100644
--- a/contrib/src/pcre/fetch_and_patch.bat
+++ b/contrib/src/pcre/fetch_and_patch.bat
@@ -19,6 +19,9 @@ rename %BUILD%\%PCRE_NAME%-%PCRE_VERSION% %PCRE_NAME%
 cd %BUILD%\%PCRE_NAME%
 
 mkdir msvc && cd msvc
+setlocal
+set PATH=C:\\Program Files\\CMake\\bin\\;%PATH%
 cmake .. -G "Visual Studio 15 2017 Win64"
+endlocal
 
 cd %SRC%
\ No newline at end of file
diff --git a/contrib/src/pjproject/fetch_and_patch.bat b/contrib/src/pjproject/fetch_and_patch.bat
index f072408b70b30651c7784b7d68cd38e0260c3409..b0f3159a46ad5afd011ffca47004a80c28e8da01 100644
--- a/contrib/src/pjproject/fetch_and_patch.bat
+++ b/contrib/src/pjproject/fetch_and_patch.bat
@@ -17,8 +17,17 @@ rename %BUILD%\pjproject-%PJPROJECT_VERSION% pjproject
 
 cd %BUILD%\pjproject
 
+echo off
+for /F "tokens=* usebackq" %%F in (`bash -c "pwd | grep /mnt/c/"`) do (
+    set NO_AUTO=%%F
+)
+if "%NO_AUTO%"=="" (
+    set ROOTPATH=/c/
+) else (
+    set ROOTPATH=/mnt/c/
+)
 set UNIXPATH=%SRC:\=/%
-set UNIXPATH=%UNIXPATH:C:=/mnt/c%
+set UNIXPATH=%ROOTPATH%%UNIXPATH:C:/=%
 bash -c "%PATCH_CMD% %UNIXPATH%pjproject/gnutls.patch"
 bash -c "%PATCH_CMD% %UNIXPATH%pjproject/ipv6.patch"
 bash -c "%PATCH_CMD% %UNIXPATH%pjproject/ice_config.patch"
diff --git a/contrib/src/yaml-cpp/fetch_and_patch.bat b/contrib/src/yaml-cpp/fetch_and_patch.bat
index d31425737fc9e3483f86a87829677ea81d8f7b22..5b5aff8f6c8ab2116647121af79436ddc7605fdc 100644
--- a/contrib/src/yaml-cpp/fetch_and_patch.bat
+++ b/contrib/src/yaml-cpp/fetch_and_patch.bat
@@ -18,6 +18,9 @@ rename %BUILD%\yaml-cpp-%YAMLCPP_VERSION% yaml-cpp
 cd %BUILD%\yaml-cpp
 
 mkdir msvc && cd msvc
+setlocal
+set PATH=C:\\Program Files\\CMake\\bin\\;%PATH%
 cmake .. -G "Visual Studio 15 2017 Win64"
+endlocal
 
 cd %SRC%
\ No newline at end of file