Workaround to remove or rename files with long names

REM map a temporary directory to the current path

subst T: .
T:

REM rename the file
rename "a-very-long-(over-200-characters-here)-name.doc" shortname.doc

REM or remove it
del "a-very-long-(over-200-characters-here)-name.doc"

REM then detach the temp. drive
C:
subst T: /d

source

Leave a Reply