Solved

Detect network drive

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

Jannes
0
Comment
Question by:jannes
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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

759 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now