DISM inject drivers into WIM gives error 2

dismwim

I have just installed a reference windows 7 x64 machine, sysprep-ed it, went into WinPE mode and captured boot.wim image using ImageX.

I then moved the boot.wim to my local PC under c:\wim, and try to inject drivers into it, before I deploy the new boot.wim to other machines. However I got an error 2: Unable to access the image.

The commands I am running are (run as administrator):

Dism /Get-WimInfo /WimFile:c:\wim\boot.wim
DISM /Mount-Wim /wimfile:c:\wim\boot.wim /index:1 /MountDir:c:\mount
Dism /Image:c:\mount /Add-Driver /Driver:c:\drivers\latitude /Recurse

I have successfully injected drivers using DISM to WinPE boot image, using the same steps. So what is wrong?!!! PS: in terms of permissions, I have full-control permission over the boot.wim file and c:\wim folder. Am really puzzled and stuck.. any input is welcome

–update–

I just looked at the log file as suggested by DSIM in the command prompt. It says the Image session has been closed. How come? How can I overcome this problem?

2013-05-21 12:27:24, Info                  DISM   DISM.EXE: Attempting to add the commands from provider: WimManager
2013-05-21 12:27:24, Info                  DISM   DISM.EXE: Succesfully registered commands for the provider: WimManager.
2013-05-21 12:27:24, Info                  DISM   DISM.EXE: Attempting to add the commands from provider: FolderManager
2013-05-21 12:27:24, Info                  DISM   DISM.EXE: Attempting to add the commands from provider: DISM Log Provider
2013-05-21 12:27:24, Info                  DISM   DISM.EXE: Attempting to add the commands from provider: Compatibility Manager
2013-05-21 12:27:24, Info                  DISM   DISM.EXE: Succesfully registered commands for the provider: Compatibility Manager.
2013-05-21 12:27:24, Error                 DISM   DISM.EXE: Failed to access the image folder or image's windows folder.
2013-05-21 12:27:24, Info                  DISM   DISM.EXE: Image session has been closed. Reboot required=no.

–update–

To list the boot.wim info, I run Dsim command and the result seems good:

C:\Windows\system32>Dism /Get-WimInfo /WimFile:c:\wim\boot.wim

Deployment Image Servicing and Management tool
Version: 6.1.7600.16385

Details for image : c:\wim\boot.wim

Index : 1
Name : Win7 Ent64
Description : <undefined>
Size : 14,986,334 bytes

The operation completed successfully.

Best Answer

this might be quite "lame" answer, but do you have UAC enabled by any chance, respectively are you running the elevated command prompt? Windows does crazy things when trying to access the system drive with UAC :)

Related Topic