• Thanks Lowell

    I need a user to be able to specify local and network drives, so I opted to choke if drive letter specfied, at least for now, but when there is a proper front end I could build in a drive / folder select and get the correct UNC path from that using the WNetGetUniversalName. I think in my circumstance am not sure using hostname() I won't know if 'c:' means users local drive or servers drive.

    So for now I have :

    IF LTRIM(@path) LIKE '[a-z]:%'

    BEGIN

    RAISERROR ('Please specify UNC path, rather than a drive letter.

    For example if you wish to search network path z:\FolderName

    then specify "\\{ServerName}\FolderName.

    If you wish to specify a local drive eg c:\FolderName

    then specify \\{YourMachineName}\FolderName"',

    16, 1, N'abcde');

    RETURN

    END

    I might build quick front end in Excel VBA - it would lend itself nicely as I can drop results into a new tab on each run - and won't need install of .net runtime 😉

    Many thanks