• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 355
  • Last Modified:

Need API function for Local system folder details

Hi Experts
Is there any API function which will show dialog box which contains
only the local drive only, not even mapped drive ?
I tried with SHBrowseForFolder but then it is allowing me to select
the mapped drive.
Awiting for your reply
0
rakesh_manohar
Asked:
rakesh_manohar
1 Solution
 
VindaCommented:
Try the FolderTreeView control (its freeware, i guess) developed by CCRP (http://www.mvps.org/ccrp). That control has the same behavior.

0
 
MadmarlinCommented:
Try the fso (File System Object) in VB.
Its amazing and I beleive will give you what you want, along with tons of cool functions that allows you to quickly retreive such information.

Cant actually remember what its referenced as but shouldn;t be too hard to find out.
The fso is basically a wrapper for loads of different API calls relating to your system structure and files..

Madmarlin
0
 
VincentLawlorCommented:
This is a bit of a work around but will restrict selection to your local machine.

Before the call to SHBrowseForFolder
Store the current valid folder in a variable.
After your call to SHBrowseForFolder
Check that the folder is a local folder with the following:

If GetDriveType(strFolderName) <> 2 then
    'Call SHBrowseForFolder again or popup a message box
End If

The code to check the drive type is:

Public Function GetDriveType(strFolderName as String) as Integer

    Dim fs,drive
    On Error Resume Next
    Set fs = CreateObject("Scripting.FileSystemObject")
    Set drive = fs.GetDrive(fs.GetDriveName(strFolderName))
    GetDriveType = drive.DriveType
    Set drive = Nothing
    Set fs = Nothing

End Function

Vin.
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
wsh2Commented:
rakesh_manohar Question History:

Questions Asked 13
Last 10 Grades Given A B A  
Question Grading Record 3 Answers Graded / 3 Answers Received

TEN Open Questions dating back to March of this year.

rakesh_manohar - PLEASE maintian YOUR other Questions with a comment, grade, or deletion before proceeding here.


0
 
VincentLawlorCommented:
wsh2
can you post the url's for the open questions I seem to remember this guy.

Vin.
0
 
wsh2Commented:
VincentLawlor:

Click on the "1.comment or answer for akesh_manohar" perlink at the bottom / top of this question -or- htp://www.experts-exchange.com/jsp/memberProfile.jsp?mbr=rakesh_manohar

and then click on the View Question history button.
0
 
VincentLawlorCommented:
wsh2 >> Cheers

Vin.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now