Unable to load DLL ‘wimgapi.dll’
When trying to import Windows 7 Enterprise into the Deployment Workbench (MDT 2010) under operating systems, I received the following error.
Performing operation “import” on Target “Operating system”.
—————————————————————————————-
Unable to get information for WIM file \\server\share\path\Install.wim .
System.DllNotFoundException: Unable to load DLL ‘wimgapi.dll’: The specified module could not be found. (Exception from HRESULT: 0x8007007E)
at Microsoft.BDD.PSSnapIn.WIMGAPI.CreateFile(String wimPath, AccessFlags desiredAccess, Disposition creationDisposition, ActionFlags flagsAndAttributes, CompressionType compressionType, UInt32& result)
at Microsoft.BDD.PSSnapIn.BDDWimFile..ctor(String wimPath, Boolean forUpdate)
at Microsoft.BDD.PSSnapIn.ImportOperatingSystem.Import(String sourcePath, String directoryName, Boolean moveDirectory)
Import processing finished.
—————————————————————————————-
Even though the “C:\Program Files\Windows Imaging” path had been added to the system %PATH% environment variable the error still occurred.
This could be because windows had not read into memory the updated system %PATH% environment settings since Windows does this during Startup. My initial reaction was to just copy the C:\Program Files\Windows Imaging\WIMGAPI.dll in the C:\Windows\System32 folder, which would have worked but is not an ideal solution in case of future updates to this file.
The easiest way to get through this error is to simply reboot your server so that the new variable is loaded into memory and that specific library can be found.
November 25th, 2009 at 8:00 am
start a cmd or Windows PowerShell and copy
set Path=%Path%;”C:\Program Files\Windows Imaging”
into it, press [RETURN]
January 1st, 2010 at 2:00 pm
Copy wimgapi.dll file
from %Program Files%\Windows Imaging
TO %Windows Root%\System32
April 27th, 2010 at 10:31 am
Orlando, as I mentioned in my article, yes copying the wimgapi.dll to the system32 folder will work, but you may run into an issue if that dll is updated with a future release. It is best to keep it where is was meant to be and ensure the mapping is set to find it there.
Thomas’ suggestion also works.