OK... so I've googled it
The the solutions seem to involved super complex answers
Why is there no easy and straight forward solution?
Why does this problem occur?
I can understand that users shouldn't be allowed to have a file name that is 1m chars long - but then set a limit and don't let the limit be exceeded in the first place
Anyway... whats the best way of solving?
Thanks
How to delete really loooooooooong file names?
Moderator: DosItHelp
Re: How to delete really loooooooooong file names?
You should rather ask Microsoft.OM3 wrote:Why is there no easy and straight forward solution?
Because there is a different handling on Windows of pathes in Unicode (UTF-16) that support long pathes and ANSI encoded pathes that support only 259 characters. Why? Ask Microsoft.OM3 wrote:Why does this problem occur?
Since this forum is about Windows Batch I should suggest ROBOCOPYOM3 wrote:whats the best way of solving?
http://superuser.com/questions/45697/ho ... lenameOK...
But note that the maximum length of a command line is 8191. Why? Ask Microsoft.
Steffen
-
- Expert
- Posts: 1166
- Joined: 06 Sep 2013 21:28
- Location: Virginia, United States
Re: How to delete really loooooooooong file names?
Where are you getting these long names from? I can't even create a file with a name+extension that exceeds 200 characters.
-
- Posts: 208
- Joined: 26 Dec 2013 09:28
- Contact:
Re: How to delete really loooooooooong file names?
To answer to your question we need to know what are you meaning when you are saying "really long file name".
1. full path is too long. For example, c:\very\long\path-name\with\very-long-file-name could exceed the OS limitation (~8K chars per the object)
2. file name itself is too long. For example, c:\some\short\path\very-very-very-long-file-name.
It is not important how these cases was accomplished. Fro example, under cygwin it is possible. In this case use the same tool or application for deletion this kind of files.
One way - I guess it is true for the case #1 above
Another way - use short names for deletion
1. full path is too long. For example, c:\very\long\path-name\with\very-long-file-name could exceed the OS limitation (~8K chars per the object)
2. file name itself is too long. For example, c:\some\short\path\very-very-very-long-file-name.
It is not important how these cases was accomplished. Fro example, under cygwin it is possible. In this case use the same tool or application for deletion this kind of files.
One way - I guess it is true for the case #1 above
Code: Select all
subst x: c:\very\long\path-name\with
del x:\very-long-file-name
subst x: /d
Another way - use short names for deletion
Code: Select all
for %f in ( "c:\very\long\path-name\with\very-long-file-name" ) do @del "%~sf"
Re: How to delete really loooooooooong file names?
ShadowThief wrote:Where are you getting these long names from? I can't even create a file with a name+extension that exceeds 200 characters.
I've had a downloading plugin for Firefox create files that Windows itself said were invalid.