SPSS Statistics

 View Only

 How to bypass 260 path characters limit in SPSS 29.0.20 (20)?

Soren V. Raben's profile image
Soren V. Raben posted Thu December 05, 2024 06:16 AM

In Windows, there is a limit of 260 characters for a file path. However, it's possible to turn it off, which I did. I need to create quite extensive report from a dataset. This report contains multiple Excel files (CTABLES tables) exported from output window. So, to avoid any problems and mistakes, I've already created folders structure for Excel files. Unfortunately, these paths (include files' names) are rather long and for a couple of reports there is the 260 characters limit exceeded. I really wish to not restructure folders and files' names. Is it possible to somehow (e.g. via environment variables) bypass this limit?

Jon Peck's profile image
Jon Peck

You can remove that limit in Windows by changing a Regedit setting.

Using regedit, look for this key

Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem

There is an item LongPathsEnabled that has value 0 by default.  Change that to 1.

Robert Lundqvist's profile image
Robert Lundqvist

It wouldn't be possible to solve this with a series of FILE HANDLE syntax commands? Something like 

FILE HANDLE dir /NAME='path to your your basic folder'.
FILE HANDLE data /NAME='dir/data'.
FILE HANDLE original_datasets /NAME='data/original'.
FILE HANDLE processed_files /NAME='data/proc_files'.

Jon Peck's profile image
Jon Peck

No.  This is a Windows issue.  The file handle would be expanded to the full path before passing it to Windows