Home All Groups Group Topic Archive Search About

Getting the physical path of network drive.

Author
29 Oct 2006 10:00 AM
rony_16
Hi ,
I am writing a program that part of than program if to add a new
network drive to the user.
The adding part i know how to do (by win api "WNetAddConnection2A") but
i want to check first if this path (network path) exist of his
computer, if it does , what is the drive name.
to do this i need some how to get the network drive on the local
computer by the network path (\\comp1\C$\reports).

How do i do that ?
some things that i found ...
* I think that i need to use "WNetGetResourceInformation"  win api
function, but i can't find how to use it.

Please help, Rony

Author
29 Oct 2006 4:09 PM
Milosz Skalecki
Hi there,

Use NetShareEnum() WinAPI function. Here you will find nice example
http://www.pinvoke.net/default.aspx/netapi32/NetShareEnum.html

hope this helps
--
Milosz Skalecki
MCP, MCAD


Show quote
"rony_16" wrote:

> Hi ,
> I am writing a program that part of than program if to add a new
> network drive to the user.
> The adding part i know how to do (by win api "WNetAddConnection2A") but
> i want to check first if this path (network path) exist of his
> computer, if it does , what is the drive name.
> to do this i need some how to get the network drive on the local
> computer by the network path (\\comp1\C$\reports).
>
> How do i do that ?
> some things that i found ...
> * I think that i need to use "WNetGetResourceInformation"  win api
> function, but i can't find how to use it.
>
> Please help, Rony
>
>

AddThis Social Bookmark Button