Search through directories on a shared network drive

When I use System.IO.Directory.GetDirectories(path, “*”, System.IO.SearchOption.AllDirectories) to search through all directories of “path” it works perfect on a folder on my local machine. When I try and use a path that is on a shared network drive, it doesn’t work. Is there a way to get this too work on the network drive?


Did you try to map this drive to local drive?

Yes, it is mapped already.

does your network drive requires authentication?

I tried to simulate the query
—kindly mention the full path of the shared drive or folder
—then kindly ensure that you got the access to all the folders because while giving access they might have given you for specific folder structure

If this is done it would work for sure
Your expression looks perfect

Cheers @path1

No, I can just go right into it.

what i can say is that GetDirectories can work fine with path like this \\mydrive\folder

My network path is Z:\folder … that path should be working for it but still no luck.

do you get an error or shows no files?

Yah is it showing any output or error

I don’t get an error, but when i tested with folders on my local machine, the directories were searched and as a result the proper files were moved. When I run the same thing but change the path to the network drive path, nothing happens.

Were we able to get the files from a folder with Directory.GetFiles method from that shared drive


Yes, I was able to do that actually.

1 Like

If possible can I have a view on the property of that drive
Like security property to check with the permissions set
Cheers @path1