Can anybody tell me why I get a file listing error on a NAS drive when using GetFiles in VB.NET?

69 Views Asked by At

I suspect that I am making a weird mistake here but searched for hours and can't seem to find a solution: I am storing AOMEI Backupper disk files from various PC's onto a NAS. To avoid the accumulation of files on the NAS, I have written an application in VB.NET to sort files and delete older sets. I map the NAS drive on a local pc, say, as Y:\Backups\PC1 etc... and although the application works perfectly well on networked pc's, it throws an 'Unable to locate part of the path' kind of error when it gets to the IO.Directory.GetFile(sPath,"*.adi") part of the code as shown below where sPath is 'for instance) Y:\Backups\PC1:

Dim files as string() = IO.Directory.GetFiles(sPath, "*.adi", IO.SearchOption.TopDirectoryOnly)

Googling for some time, I have seen many issues like this but no real useful answer.

Any idea/help would be greatly appreciated!

Cheers from Paris, France and stay healthy!

Philippe

0

There are 0 best solutions below