Solved

Detect network drive

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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

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.

Question has a verified solution.

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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

808 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