Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > General Computer Discussion > General Computer Support > C# Shell32 - Error: The system cannot find the file specified.

Thread Tools

C# Shell32 - Error: The system cannot find the file specified.

cmedine cmedine is offline
Junior Member
Join Date: Jan 2011
Posts: 1

I am using Shell32 to unzip files, but am getting the famous vague error:
The system cannot find the file specified. (Exception from HRESULT: 0x80070002). The error is thrown at the srcFlder declaration.

Here is my code - Any help is appreciated:

DirectoryInfo di = new DirectoryInfo(@"C:\Test\");
            foreach (FileInfo fi in di.GetFiles("*.zip"))
                foreach (DirectoryInfo dir in destinationDir)
                    String file = fi.ToString();
                    var destinationPath = @"C:\AppName\";
                    if (!Directory.Exists(destinationPath))

                    Shell sh = new Shell();     
                    Folder destFlder = sh.NameSpace(destinationPath);
                    Folder srcFlder = sh.NameSpace(fi.FullName);
                    foreach (FolderItem F in srcFlder.Items()) 
                           { destFlder.CopyHere(F,null); }                                

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Parser Error Message: Could not load file or assembly 'AjaxControlToolkit' or one of its dependencies. The system cannot find the file specified. hifiger2004 ASP .Net Web Controls 1 08-30-2007 04:12 PM
How to strong name an assembly which use interop.shell32? Nicola Garone ASP .Net Building Controls 1 04-19-2004 02:27 PM
WinXP "Windows Explorer has encountered a problem and needs to close...." Shell32.dll and ntdll.dll question. Sparky Computer Support 3 01-24-2004 11:53 AM
PathCleanupSpec - Shell32.dll Tim C++ 1 01-08-2004 04:56 AM
Explorer Caused an Invalid Page Fault in Module Shell32.dll (WINXP) Sparky Computer Support 2 12-31-2003 09:02 PM