-REM dism /capture-image /capturedir:in.dir /imagefile:test.wim /name:"test" /norpfix > nul\r
-REM if %errorlevel% neq 0 goto :fail\r
-dism /apply-image /imagefile:test.wim /index:1 /applydir:out.dir > nul\r
-if %errorlevel% neq 0 goto :fail\r
-%WIN32_TREE_CMP% in.dir out.dir\r
+if %skip_dism_apply% neq 1 (\r
+ dism /apply-image /imagefile:test.wim /index:1 /applydir:out.dir > nul\r
+ if !errorlevel! neq 0 (\r
+ echo ERROR: DISM apply failed!\r
+ goto :fail\r
+ )\r
+ if %skip_dism_cmp% neq 1 (\r
+ %WIN32_TREE_CMP% in.dir out.dir\r
+ if !errorlevel! neq 0 (\r
+ echo ERROR: DISM comparison failed!\r
+ goto :fail\r
+ )\r
+ )\r
+)\r