Solved

Detect network drive

Posted on 1998-12-08
2
1,020 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

910 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

16 Experts available now in Live!

Get 1:1 Help Now