return sharename using System.IO?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

I have been looking through the docs on System.IO and cannot find a way to
return a share name on a mapped drive.

I have done this using FileSystemObject.Drive.ShareName, but I don't want to
have to reference the Scripting.dll just to get a drive's sharename while
using System.IO for everything else.

Thanks in advance. I appreciate your help.
 
I have used a combination of API's WNetGetUniversalName and
NetShareEnum.
WNetGetUniversalName gives you the mapped drives, NetShareEnum gives you
the
local shared drives. By checking both of these you can establish the UNC
name of a folder or file.
 
Scorpion,

I did not want to give you two times in a row a compliment.

I was writting that as well about this one.

This has been often as question in the newsgroup and I saw not a real answer
before I saw yours about those API's.

I don't need it, however next time a sample will help probably a lot of
people and gives me a reference to point too

Cor
 
Kelly,

I started this with Scorpion and that I found not nice while I usaly use
Kelly for that.

That Scorpion = Kelly was for you not in general.

That is all

Cor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top