Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8956925
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T14:52:26+00:00 2026-06-15T14:52:26+00:00

I came across this excellent article that solves the problem of enumerating disconnected drives

  • 0

I came across this excellent article that solves the problem of enumerating disconnected drives in C#:
Mapped network drives cannot be listed in C#

The problem is that it seems like this code will NOT include NTFS-formatted drives (only FAT)

As I’m not a C++/WinAPI techie, I find it hard to fix the code (if possible at all).
Any chance anyone already look into it and solved it, or at least give me a hint?

Thanks!
Busi

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T14:52:27+00:00Added an answer on June 15, 2026 at 2:52 pm

    OK, I have an answer. It has nothing to do with NTFS and FAT.

    This is the code I used to enumerate the drives:

    WNetOpenEnum( RESOURCE_SCOPE.RESOURCE_REMEMBERED, RESOURCE_TYPE.RESOURCETYPE_DISK, 0, resource, out ptrHandle);

    Please note the first parameter, RESOURCE_SCOPE.RESOURCE_REMEMBERED. This mean that the method will only enumerate those mapped drives that were set as PERSISTED (which means, re-connect at logon).

    If I change for example the parameter to RESOURCE_SCOPE.RESOURCE_CONNECTED, it will enumerate the non-persisted drives, if they are connected.

    If you want all the combinations, you can do:
    WNetOpenEnum(RESOURCE_SCOPE.RESOURCE_REMEMBERED | RESOURCE_SCOPE.RESOURCE_RECENT | RESOURCE_SCOPE.RESOURCE_CONNECTED, RESOURCE_TYPE.RESOURCETYPE_DISK, 0,
    resource, out ptrHandle);

    Thank you!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I came across this problem when I want to check what I input is
I came across this problem at work, and though I have a solution, I
I came across this article written by Andrei Alexandrescu and Petru Marginean many years
I came across this excellent piece of code over at http://projecteuler.net/ but I'm having
I came across this excellent little RegEx to replace URLs (not hyper-links) in plain
I came across this elegant implementation of Pascal's triangle that uses a lazy sequence.
I came across this article on dynamic linking in C++. We can create a
I came across this rather interesting way to create a JavaScript singleton that can
Just came across this guy that left me stunned: gcc -E -dM - </dev/null
I came across this problem, I have a number of type long which represents

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.