Windows 下文件名过长如何删除?

Windows 下文件名过长如何删除?

如果允许编程的话,我倒知道一种方法:

引用MSDN(

)

Deletes an existing file.

To perform this operation as a transacted operation, use the DeleteFileTransacted function.

The name of the file to be deleted.

In the ANSI version of this function, the name is limited to MAX_PATH characters. To extend this limit to 32,767 wide characters, call the Unicode version of the function and prepend "\\?\" to the path. For more information, see Naming a File.

用DeleteFileW(也就是Unicode版本)以\\?\的方式来处理路径,可以使用长度达到32767宽字符的文件名,再长的话可能就要写驱动了。