260 Char file path limit

Excelislife

New Member
Joined
Jun 3, 2016
Messages
11
Hello, I have questions concerning the 260 char limit for file paths. I have found several sources discussing this (I already have the one from microsoft), and even that you can use "\\?" at the beginning of the file path to overcome this, but not a lot of info on how to implement this. Can anyone assist?

1. I am going through and finding and copying the names of thousands of files and putting them in an Excel file. File paths longer than 260 are not going being copied.
2. The macro was written by someone else that is no longer with the company (of course).
3. The macro uses the filesys object to loop through all the folders to obtain the name and uses Range(A1)=fileobj.path
4. This is in a shared drive, the "\\?" seems to apply to drives that begin with a letter "C:", these start with just 2 forward Slashes.

Am I going in the right direction? Is it possible to add this "\\?" to file path in the object? I've also read that dir(Filepath) also has the same 260 Char limitations? Many thanks, to all who have any information.
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"

Forum statistics

Threads
1,214,912
Messages
6,122,204
Members
449,072
Latest member
DW Draft

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top