diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 7da3968c0259ab44cb962af5d5dfb8115180904d..6f705e87001a0980c5b14a3e1b1ca53e90db4c57 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -15,11 +15,7 @@ build-3.7-VS2017:
   before_script:
     - git submodule sync --recursive
     - git submodule update --init --recursive
-  script:
-    - ' &"set Path=%Path%;C:\Program Files\Python37;C:\Program Files\Python37\Scripts;C:\Program Files\CMake\bin;"'
-    - 'virtualenv.exe --clear -p "C:\Program Files\Python37\python.exe" .'
-    - call .\Scripts\activate
-    - python setup.py bdist_wheel --dist-dir dist3
+  script: "CI\\build-3.7-VS2017.bat"
   artifacts:
     paths:
       - dist3/
@@ -32,7 +28,7 @@ build-3.7-linux:
   variables:
     GIT_SUBMODULE_STRATEGY: recursive
   script:
-    - virtualenv --clear -p python3.7 .
+    - virtualenv -p python3.7 .
     - source bin/activate
     - python setup.py bdist_wheel --dist-dir dist3
   artifacts:
@@ -48,10 +44,7 @@ build-3.5-macos:
     GIT_SUBMODULE_STRATEGY: recursive
   script:
     - export PATH=/opt/local/bin:$PATH
-    - virtualenv --clear -p python3.5 .
-    - pwd
-    - ls
-    - ls /opt/local/bin
+    - virtualenv -p python3.5 .
     - source bin/activate
     - python setup.py bdist_wheel --dist-dir dist3
   artifacts:
@@ -66,7 +59,7 @@ build-2.7-linux:
   variables:
     GIT_SUBMODULE_STRATEGY: recursive
   script:
-    - virtualenv --clear -p python2.7 .
+    - virtualenv -p python2.7 .
     - source bin/activate
     - python setup.py bdist_wheel --dist-dir dist2
   artifacts:
@@ -82,10 +75,7 @@ build-2.7-macos:
     GIT_SUBMODULE_STRATEGY: recursive
   script:
     - export PATH=/opt/local/bin:$PATH
-    - virtualenv --clear -p python2.7 .
-    - pwd
-    - ls
-    - ls /opt/local/bin
+    - virtualenv -p python2.7 .
     - source bin/activate
     - python setup.py bdist_wheel --dist-dir dist2
   artifacts:
@@ -100,14 +90,7 @@ test-3.7-VS2017:
     - python37
   dependencies:
     - build-3.7-VS2017
-  script:
-    - set Path=%Path%;C:\Program Files\Python37;C:\Program Files\Python37\Scripts;
-    - virtualenv.exe --clear -p "C:\Program Files\Python37\python.exe" .
-    - call .\Scripts\activate
-    - cd dist3
-    - FOR %%a IN (*.whl) DO pip install %%a
-    - cd ..\tests
-    - python -m unittest discover
+  script: "CI\\test-3.7-VS2017.bat"
 
 test-3.7-linux:
   stage:
@@ -117,7 +100,7 @@ test-3.7-linux:
   dependencies:
     - build-3.7-linux
   script:
-    - virtualenv --clear -p python3.7 .
+    - virtualenv -p python3.7 .
     - source bin/activate
     - pip install dist3/*.whl
     - cd tests
@@ -132,7 +115,7 @@ test-3.5-macos:
     - build-3.5-macos
   script:
     - export PATH=/opt/local/bin:$PATH
-    - virtualenv --clear -p python3.5 .
+    - virtualenv -p python3.5 .
     - source bin/activate
     - pip install dist3/*.whl
     - cd tests
@@ -146,7 +129,7 @@ test-2.7-linux:
   dependencies:
     - build-2.7-linux
   script:
-    - virtualenv --clear -p python2.7 .
+    - virtualenv -p python2.7 .
     - source bin/activate
     - pip install dist2/*.whl
     - cd tests
@@ -161,7 +144,7 @@ test-2.7-macos:
     - build-2.7-macos
   script:
     - export PATH=/opt/local/bin:$PATH
-    - virtualenv --clear -p python2.7 .
+    - virtualenv -p python2.7 .
     - source bin/activate
     - pip install dist2/*.whl
     - cd tests
@@ -175,10 +158,7 @@ deploy-3.7-VS2017:
     - python37
   dependencies:
     - build-3.7-VS2017
-  script:
-    - mkdir release
-    - cd dist3
-    - FOR %%a IN (*.whl) DO copy %%a ..\release
+  script: "CI\\deploy-3.7-VS2017.bat"
   artifacts:
     paths:
       - release/*.whl
@@ -247,7 +227,7 @@ deploy-sdist:
   variables:
     GIT_SUBMODULE_STRATEGY: recursive
   script:
-    - virtualenv --clear -p python3.7 .
+    - virtualenv -p python3.7 .
     - source bin/activate
     - python setup.py sdist --dist-dir release
   artifacts:
@@ -262,7 +242,7 @@ deploy-documentation:
   dependencies:
     - build-3.7-linux
   script:
-    - virtualenv --clear -p python3.7 .
+    - virtualenv -p python3.7 .
     - source bin/activate
     - pip install dist3/*.whl
     - pip install sphinx sphinx_rtd_theme
diff --git a/CI/build-3.7-VS2017.bat b/CI/build-3.7-VS2017.bat
new file mode 100644
index 0000000000000000000000000000000000000000..f23dd8d1a1db8f8b5034c12050d9a088c41653c4
--- /dev/null
+++ b/CI/build-3.7-VS2017.bat
@@ -0,0 +1,4 @@
+set PATH=C:\Program Files\Python37;C:\Program Files\Python37\Scripts;C:\Program Files\CMake\bin;%PATH%
+virtualenv -p "C:\Program Files\Python37\python.exe" .
+call .\Scripts\activate
+python setup.py bdist_wheel --dist-dir dist3
diff --git a/CI/deploy-3.7-VS2017.bat b/CI/deploy-3.7-VS2017.bat
new file mode 100644
index 0000000000000000000000000000000000000000..2893a6620bbe24e41ada8a0c67c9e73532b88cab
--- /dev/null
+++ b/CI/deploy-3.7-VS2017.bat
@@ -0,0 +1,3 @@
+mkdir release
+cd dist3
+FOR %%a IN (*.whl) DO copy %%a ..\release
diff --git a/CI/test-3.7-VS2017.bat b/CI/test-3.7-VS2017.bat
new file mode 100644
index 0000000000000000000000000000000000000000..0dc13107fb160496445419041d7fc6aefea22817
--- /dev/null
+++ b/CI/test-3.7-VS2017.bat
@@ -0,0 +1,7 @@
+set PATH=C:\Program Files\Python37;C:\Program Files\Python37\Scripts;%PATH%
+virtualenv -p "C:\Program Files\Python37\python.exe" .
+call .\Scripts\activate
+cd dist3
+FOR %%a IN (*.whl) DO pip install %%a
+cd ..\tests
+python -m unittest discover