UNC path with codeunit 412

Does anyone know if it’s possible to get the UNC path using codeunit 412? I use codeunit 412 to select a file in a networkfolder and store the path in a tablefield. I prefer to store the unc path (\server\groups\folder\document.doc) instead of the path codeunit 412 gives me now (H:\folder\document.doc). Is this possible? Thanking you in advance, Marcel

Take a look at the ShareName Property of the Drive object – another trick provided by the Windows Scripting Host… Here’s the reference info: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/jsprosharename.asp Here’s a C/AL function based on the reference:

PROCEDURE GetUNCPath(DrvPath : Text[250]) : Text[250] VAR wshFSO : Automation 'Windows Script Host Object Model'.FileSystemObject; wshDrive : Automation 'Windows Script Host Object Model'.Drive; BEGIN CREATE(wshFSO); wshDrive := wshFSO.GetDrive( wshFSO.GetDriveName( wshFSO.GetAbsolutePathName(DrvPath))); IF wshDrive.ShareName <> '' THEN EXIT(wshDrive.ShareName + COPYSTR(DrvPath,3)) ELSE EXIT(DrvPath); END;

Thanks Fritz! Just what i was looking for. It works great. Best regards Marcel Bierens