diff --git a/image_creator/os_type/windows.py b/image_creator/os_type/windows.py
index 3b2ac39c8248eb88b3b0567bc906c155d6ff4f0b..5fcfe823edd9668a9293f273b60e5daf5281cbf3 100644
--- a/image_creator/os_type/windows.py
+++ b/image_creator/os_type/windows.py
@@ -217,13 +217,13 @@ class Windows(OSBase):
 
         # Query for the maximum number of reclaimable bytes
         cmd = (
-            r'cmd /Q /C "SET SCRIPT=%TEMP%\QUERYMAX_%RANDOM%.TXT & ' +
+            r'cmd /Q /V:ON /C "SET SCRIPT=%TEMP%\QUERYMAX_%RANDOM%.TXT & ' +
             r'ECHO SELECT DISK 0 > %SCRIPT% & ' +
             'ECHO SELECT PARTITION %d >> %%SCRIPT%% & ' % self.last_part_num +
             r'ECHO SHRINK QUERYMAX >> %SCRIPT% & ' +
             r'ECHO EXIT >> %SCRIPT% & ' +
             r'DISKPART /S %SCRIPT% & ' +
-            r'IF ERRORLEVEL 1 EXIT /B 1 & ' +
+            r'IF NOT !ERRORLEVEL! EQU 0 EXIT /B 1 & ' +
             r'DEL /Q %SCRIPT%"')
 
         stdout, stderr, rc = self._guest_exec(cmd)
@@ -255,14 +255,16 @@ class Windows(OSBase):
             self.out.warn("Not enought available space to shrink the image!")
             return
 
+        self.out.output("\tReclaiming %dMB ..." % querymax)
+
         cmd = (
-            r'cmd /Q /C "SET SCRIPT=%TEMP%\QUERYMAX_%RANDOM%.TXT & ' +
+            r'cmd /Q /V:ON /C "SET SCRIPT=%TEMP%\QUERYMAX_%RANDOM%.TXT & ' +
             r'ECHO SELECT DISK 0 > %SCRIPT% & ' +
             'ECHO SELECT PARTITION %d >> %%SCRIPT%% & ' % self.last_part_num +
             'ECHO SHRINK DESIRED=%d >> %%SCRIPT%% & ' % querymax +
             r'ECHO EXIT >> %SCRIPT% & ' +
             r'DISKPART /S %SCRIPT% & ' +
-            r'IF ERRORLEVEL 1 EXIT /B 1 & ' +
+            r'IF NOT !ERRORLEVEL! EQU 0 EXIT /B 1 & ' +
             r'DEL /Q %SCRIPT%"')
 
         stdout, stderr, rc = self._guest_exec(cmd)