Local and server paths question.

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

Guest

Hi,
I have in my PC the 'F:\' drive, it is an alias to '\\SERVER1\\DOCS'
How can I get the real path for 'F:\'?
How can I determine if 'F:\', 'G:\', etc. is a local drive drive or an alias
to SERVER path?
How can I determine if '\\SERVER1\\DOCS' has an alias in my local PC?
I am using VC6.00.

Thanks in advance,
William GS
 
William GS said:
I have in my PC the 'F:\' drive, it is an alias to '\\SERVER1\\DOCS'
How can I get the real path for 'F:\'?

You can use the WNetGetUniversalName() function:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wnet/wnet/wnetgetuniversalname.asp
How can I determine if 'F:\', 'G:\', etc. is a local drive or an alias
to SERVER path?

See GetDriveType() here:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/fs/getdrivetype.asp

It will tell you if a drive is fixed, removable or remote.
How can I determine if '\\SERVER1\\DOCS' has an alias in my local PC?
I am using VC6.00.

I'm not sure if this is the best way, but one thing you can do is call

WNetOpenEnum() with RESOURCETYPE_DISK

to open an enumeration of all of the networked disk resources on a machine
and then use

WNetEnumResource()

to get information about each one. Don't forget to call

WNetCloseEnum()

when you are done.

Regards,
Will
 
Back
Top