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?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
nappy_dThere are a 1000 ways to skin the technology cat.Author Commented:
Was able to self-resolve issue.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows Batch

From novice to tech pro — start learning today.