LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

full pathname

How can I get the full pathname (including drive) from a file?
Example: "p:\\temp\\main.c"
Full Pathname: "\\dcserver\\programming\\temp\\main.c"
0 Kudos
Message 1 of 2
(2,979 Views)
You can get the UNC translation of a drive letter using the Windows API function WNetGetConnection(). E.g.:

#include

char retBuf[300];
DWORD retBufLen = 300;
DWORD status;

status = WNetGetConnection("P:",retBuf,&retBufLen);

You will need to install the Windows SDK to access this function.

Martin.
--
Martin
Certified CVI Developer
0 Kudos
Message 2 of 2
(2,965 Views)