I am unzipping a file on a XP machine.
to do this i am using the Shell process
For Each setfiles As String In My.Computer.FileSystem.GetFiles(mydesktop, FileIO.SearchOption.SearchTopLevelOnly, "*.zip")
If setfiles.Count = 0 Then
setfiles = Nothing
Exit For
Else
Dim myshell As New Shell32.Shell
Dim myzip As Shell32.Folder = myshell.NameSpace(setfiles)
Dim mydrop As Shell32.Folder = myshell.NameSpace(mydesktop)
For Each myzipfiles As Shell32.FolderItems In myzip.Items
mydrop.CopyHere(myzipfiles)
Next
End If
Next
This was built on VS 2008 on a vista machine on this machine this process works perfectly when ported over to an XP (with new frameworks v3.5) i get this error
System.InvalidCastException: Unable to cast COM object of type 'Shell32.ShellClass' to interface type 'Shell32.IShellDispatch5'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{866738B9-6CF2-4DE8-8767-F794EBE74F4E}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).
at Shell32.ShellClass.NameSpace(Object vDir)
What would the reason behind this be, i have to be able to run this on a xp machine.
to do this i am using the Shell process
For Each setfiles As String In My.Computer.FileSystem.GetFiles(mydesktop, FileIO.SearchOption.SearchTopLevelOnly, "*.zip")
If setfiles.Count = 0 Then
setfiles = Nothing
Exit For
Else
Dim myshell As New Shell32.Shell
Dim myzip As Shell32.Folder = myshell.NameSpace(setfiles)
Dim mydrop As Shell32.Folder = myshell.NameSpace(mydesktop)
For Each myzipfiles As Shell32.FolderItems In myzip.Items
mydrop.CopyHere(myzipfiles)
Next
End If
Next
This was built on VS 2008 on a vista machine on this machine this process works perfectly when ported over to an XP (with new frameworks v3.5) i get this error
System.InvalidCastException: Unable to cast COM object of type 'Shell32.ShellClass' to interface type 'Shell32.IShellDispatch5'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{866738B9-6CF2-4DE8-8767-F794EBE74F4E}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).
at Shell32.ShellClass.NameSpace(Object vDir)
What would the reason behind this be, i have to be able to run this on a xp machine.