Solved

Detect network drive

Posted on 1998-12-08
2
1,026 Views
Last Modified: 2008-01-09
How to detect whether or not a drive is a network drive ?

Jannes
0
Comment
Question by:jannes
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 

Accepted Solution

by:
Llysander earned 0 total points
ID: 1349859
\\HKEY_CURRENT_USER\Network\ contains a key for every currently mapped network drive.

example : Drive J is mapped to \\server\share the key would read
\\HKEY_CURRENT_USER\Network\J
Values inside include path, login name, connection type, etc.

From this it is fairly simple to generate a list of network drives.  It's just a list of all the subkeys under \network\
0
 

Expert Comment

by:Tulip
ID: 1349860
Just use the GetDriveType function. If it returns 4 it is a network drive.
See Delphi online-help for details.

For better understanding:

if GetDriveType(PChar('R:\')) = 4 then ShowMessage('R:\ is a network drive');
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Create Database on Android via Delphi dbExpress 3 129
Delphi...Split view - idea? 1 115
Delphi and Access based Enumeration 9 78
Get weeknumber and year from date 4 28
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question