By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,960 Members | 2,232 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,960 IT Pros & Developers. It's quick & easy.

Is Folder Local

P: n/a
Is there a way to tell if path is on a local drive instead of a mapped drive
or network. Thanks

- Fred
Sep 22 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Hi,

Are you in 2.0 ? if so there is a new class DriveInfo tht can give you this
info.

Don't quite remember how to get it in 1.1 (without using either w32 or WMI)
do a search in the archives.

"Fred W." <fr*************@yahoo.comwrote in message
news:eB****************@TK2MSFTNGP06.phx.gbl...
Is there a way to tell if path is on a local drive instead of a mapped
drive or network. Thanks

- Fred

Sep 22 '06 #2

P: n/a
In the windows api kernel32.dll there is a function GetDriveTypeA
it takes in a string containing the drive letter and returns an int which
means:
2 = Removable Drive
3 = Fixed Drive
4 = Remote / Network drive
5 = CDROM/DVD
6 = Ram Disk

HTH
Ciaran O'Donnell

"Fred W." wrote:
Is there a way to tell if path is on a local drive instead of a mapped drive
or network. Thanks

- Fred
Sep 22 '06 #3

P: n/a

"Fred W." <fr*************@yahoo.comwrote in message
news:eB****************@TK2MSFTNGP06.phx.gbl...
| Is there a way to tell if path is on a local drive instead of a mapped
drive
| or network. Thanks
|
| - Fred
|
|

DriveInfo.DriveType.
But this requires a mapped drive which is something you should avoid in your
code whenever you can. Use UNC paths (\\server\path\file) to access network
shares.

Willy.
Sep 22 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.