DISM ffu errors

I have a batch script that I am attempting to use from a WinPE boot disk to capture and restore hard drives.

Here is the snippet of code I have that is failing.

echo Please locate image name from list below
echo ==========================================
echo Here are the images we found on your drive
echo ==========================================
echo ==========================================
@echo off
for %%p in (c d e f g h i j k l m n o p q r s t u v w x y z) do if exist %%p:\images set w=%%p:\
dir /b /w %w%images
echo ==========================================
echo ==========================================
echo Press enter when you are ready
pause


:imageName
@ECHO OFF
SET /P imageName=Please system image name for deployment: 
IF "%imageName%"=="" GOTO imageNameError else goto deploy

:deploy
@echo off
for %%p in (c d e f g h i j k l m n o p q r s t u v w x y z) do if exist %%p:\images set w=%%p:\
DISM /apply-ffu /ImageFile=%w%images\%imageName%.ffu /ApplyDrive:\\.\PhysicalDrive0

Open in new window


If I however go to the path containing the ffu image and run this snippet of code, manually, it works.

Anyone else using DISM and encountered this?

DISM /apply-ffu /ImageFile=d:\images\windows.ffu /ApplyDrive:\\.\PhysicalDrive0

Open in new window

LVL 32
nappy_dThere are a 1000 ways to skin the technology cat.Asked:
Who is Participating?
 
nappy_dConnect With a Mentor There are a 1000 ways to skin the technology cat.Author Commented:
issue resolved!

I explicitly had to set the path for dism from the WinPE environment

:deploy
@echo off
for %%p in (c d e f g h i j k l m n o p q r s t u v w x y z) do if exist %%p:\images set w=%%p:\
x:\windows\system32\DISM.exe /apply-ffu /ImageFile=%w%images\%imageName%.ffu /ApplyDrive:\\.\PhysicalDrive0

Now off to the races :D

I'll be posting an article on this and some other cool utils/tools I have compiled.
0
 
Michael PfisterCommented:
Does it list the available images when you start the batch?

Are you getting any error message?
0
 
nappy_dThere are a 1000 ways to skin the technology cat.Author Commented:
Here is a screenshot of the error message when I run this from the batch script.

From what I have ben able to find, this error 0xfffffff means file not found.

DISM Error
I then decided to print on the screen the command that runs after filling in the information prompts and it produces this output. As you can see, the command completed successfully but never applies the image.

:deploy
@echo off
for %%p in (c d e f g h i j k l m n o p q r s t u v w x y z) do if exist %%p:\images set w=%%p:\
echo DISM /apply-ffu /ImageFile=%w%images\%imageName%.ffu /ApplyDrive:\\.\PhysicalDrive0

Open in new window


Screen-Shot-2018-03-15-at-9.49.01-AM.png
0
 
nappy_dThere are a 1000 ways to skin the technology cat.Author Commented:
Was able to self-resolve issue.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.