CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1

    How to search for hidden folder?

    A folder has been hidden from the view of Explorer and MS DOS box, I can't see the folder even setting the Explorer to show all files.

    Is there a way to confirm this folder does exist under Windows98 if I know the folder name?

  2. #2
    Join Date
    Feb 2002
    Posts
    5,757
    Try FindFirstFile() and pass in the directory.

    Kuphryn

  3. #3
    Join Date
    May 2000
    Location
    KY, USA
    Posts
    18,652
    Code:
    CString szPath("c:\\windows");
    
    DWORD dwAttr = GetFileAttributes(szPath);
    if (dwAttr == 0xffffffff)
    {
      DWORD dwError = GetLastError();
      if (dwError == ERROR_FILE_NOT_FOUND)
      {
        // file not found
      }
      else if (dwError == ERROR_PATH_NOT_FOUND)
      {
        // path not found
      }
      else if (dwError == ERROR_ACCESS_DENIED)
      {
        // file or directory exists, but access is denied
      }
      else
      {
        // some other error has occured
      }
    }
    else
    {
      if (dwAttr & FILE_ATTRIBUTE_DIRECTORY)
      {
        // this is a directory
      }
      else
      {
        // this is an ordinary file
      }
    }

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured