This is an extremely basic/entry level question, so please move it to the appropriate newbie forum. I also wrote this in html just to see all my tags being cheerfully ignored, but I digress.
Now that is out, let's get to the point. So we have error 0x80070002, "The system cannot find the file specified." The first thing I think of is permissions; a classical example could be <tt>dism</tt> trying to open a <tt>.cab</tt> file. I will use the <tt>dism</tt> because I can get some kind of logs. A typical log of this event would look something like this:
2015-08-25 22:49:28, Info DISM DISM Package Manager: PID=2668 TID=1964 Routing the command... - CPackageManagerCLIHandler::ExecuteCmdLine 2015-08-25 22:49:28, Info DISM DISM Package Manager: PID=2668 TID=1964 Encountered the option "packagepath" with value "c:\somewhere\package.cab" - CPackageManagerCLIHandler::Private_GetPackagesFromCommandLine 2015-08-25 22:49:28, Error DISM DISM Package Manager: PID=2668 TID=1964 Failed opening package. - CDISMPackageManager::Internal_CreatePackageByPath(hr:0x80070002) 2015-08-25 22:49:28, Error DISM DISM Package Manager: PID=2668 TID=1964 Failed to get the underlying CBS package. - CDISMPackageManager::OpenPackageByPath(hr:0x80070002) 2015-08-25 22:49:28, Error DISM DISM Package Manager: PID=2668 TID=1964 Failed to open the package at location: "c:\somewhere\package.cab" - CPackageManagerCLIHandler::ProcessPackagePath(hr:0x80070002) 2015-08-25 22:49:28, Error DISM DISM Package Manager: PID=2668 TID=1964 Failed while processing command add-package. - CPackageManagerCLIHandler::ExecuteCmdLine(hr:0x80070002)
What does that error actually means?
- The first assumption would be that the user the path is invalid, so I will try to see if I can see the file as a garden-variety user
PS C:\somewhere> dir C:\somewhere\package.cab Directory: C:\somewhere Mode LastWriteTime Length Name ---- ------------- ------ ---- -a--- 8/25/2015 12:08 PM 6384 package.cab PS C:\somewhere>
- Maybe the program is being run as a user that has no read rights on the file. We must then find out which user can do what to this file:
- I have seen threads stating that one of the causes for this error is a corrupted file. Unfortunately I do not have the md5sum for this specific .cab but I have no problems extracting its contents from command line, so I must take that it is good. That said, being able to see <tt>Private_GetPackagesFromCommandLine</tt> would answer such questions.
PS C:\somewhere> dir C:\somewhere\package.cab|get-acl| ForEach-Object { $_.Access } FileSystemRights : FullControl AccessControlType : Allow IdentityReference : THE-SERVER\Administrator IsInherited : False InheritanceFlags : None PropagationFlags : None FileSystemRights : FullControl AccessControlType : Allow IdentityReference : NT AUTHORITY\SYSTEM IsInherited : True InheritanceFlags : None PropagationFlags : None FileSystemRights : FullControl AccessControlType : Allow IdentityReference : BUILTIN\Administrators IsInherited : True InheritanceFlags : None PropagationFlags : None FileSystemRights : ReadAndExecute, Synchronize AccessControlType : Allow IdentityReference : BUILTIN\Users IsInherited : True InheritanceFlags : None PropagationFlags : None PS C:\somewhere>
That makes me think that the host and all administrators in general and the local one specifically can do whatever they want with the file while all users can read and execute it. Which permissions does <tt>DISM</tt> (and <tt>Private_GetPackagesFromCommandLine</tt> by extension) require to open the <tt>.cab</tt> file?
Apologies for using dism here since I am more concerned about understanding the error, but I needed something to illustrate it that would eliminate as much cruft as I could.
- Edited by Rocket de Pouche Wednesday, August 26, 2015 1:26 PM