Home » Questions » Computers [ Ask a new question ]

Renaming long file name with illegal characters [duplicate]

Renaming long file name with illegal characters [duplicate]

"I have a 2GB file in windows which has a long file name FileTransfer.dll?Cmd=1&MN=1619353607&Dir=1&Mode=0&Off=0&TS=FA596160-1BFB-4113-9E10-B196243A73F3&CVN=5,0,0,32
I am not sure how it got the filename that way (perhaps from the download manager)"

Asked by: Guest | Views: 69
Total answers/comments: 1
Guest [Entry]

"In many cases, the simplest way to do this is to quote the filename.


  • rename ""long-file-name-here"" new-short-file-name

    The quotes protect the wonky characters (? and & and others) from being interpreted by the shell as special characters. (In the Windows CMD shell, ? is a single-character wildcard. The quotes tell CMD not to interpret it that way.)

    Sometimes this doesn't work for other reasons, and you'll need to resort to one of the other techniques mentioned. But this one is the one to try first.

  • Unix shells would prefer single-quotes ('foo') instead of double-quotes (""foo"") for complete protection from shell interpretation. The CMD shell seems to prefer double-quotes."