#8 Scan for FileSysDriveRoot on windows


There are a number of ways to determine the available
drive roots under windows. Would it be possible to
use these for determining the
explorerFileSysRootDefault value instead of requiring
a new user to find then alter this value just to open
a file. The current system makes the "out of box"
experience seem cumbersome.

Alternately, making the standard windows file dialog
the default file dialog would provide the same basic
feature (+ making the app feel more native, providing
file-management, etceteras).


import win32api
import string

or (slower, but doesn't require any extensions):

result = []
for x in range(97, 123):
driveName = '%s:\\'%(chr(x))
if os.path.exists( driveName ):
result.append( driveName )



  • Riaan Booysen

    Riaan Booysen - 2001-08-18
    • assigned_to: nobody --> riaan
    • status: open --> pending
  • Riaan Booysen

    Riaan Booysen - 2001-08-18

    Logged In: YES

    Ok this is done in my local copy, I'll close this item when it is checked in.

    Thanks for the tips, this has bothered me before as well.
    (btw I'm using the plain python version).

    One slight complication. It is the intention that you may also define UNC network paths under filesystem.
    Therefor the drive detection test only runs when the filesystem entry in the config file is blank. (which it will be from
    now on in a fresh installation)


  • Mike C. Fletcher

    • status: pending --> open
  • Mike C. Fletcher

    Logged In: YES

    Okay, minor note: the number should be 99, as 97 will try
    to check the a and b drives, which takes a while and can
    cause the system to pop up dialogs (doesn't seem to cause a
    problem for CDs not-in-drive, but does for floppies).

    Why not do it and use extend to get the preference
    setting? Otherwise they'll need to enter every single
    local drive letter just to get the single UNC name (you'll
    likely get error reports like: "When I add a UNC name to my
    file root, I lose access to all the local drives. I've
    tried re-installing the windows netbios stack with no
    effect. I can't find a network only setting anywhere, but
    I must have turned it on." without it).

  • Riaan Booysen

    Riaan Booysen - 2001-08-18

    Logged In: YES

    Yeah, I decided on 99 too.

    I'll refer such support calls to you, but I doubt it will be necessary ;)

    Let me try to explain again:
    Freshly installed Boa starts with an empty filesystem definition
    When Boa starts up and there is an empty filesystem definition, it detects the drives and populates the explorer
    config entry.
    Now the user may add UNC paths to the filesystem list.

    Does this make more sense?

  • Riaan Booysen

    Riaan Booysen - 2001-09-05
    • status: open --> closed
  • Riaan Booysen

    Riaan Booysen - 2001-09-05

    Logged In: YES

    Available in CVS, check it out!


Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks