Deleting a file with illegal characters in the file name

Soldato
Joined
16 Nov 2003
Posts
9,682
Location
On the pale blue dot
Annoyingly, I extracted a tar file destined for a Linux system which contains a file with the name along the lines of foo::bar. If I try to delete the file, I get a file not found message, and I get a syntax error if I try and delete the file through the command prompt. Clearly this is because there are colons in the name. How can I get rid of this?
 
can you shove it in a folder on it's own then use a wildcard to remove it? I've done that in the past for a file from a Mac that caused problems.

I just moved the contents of the folder (except the dodgy file), command prompt and did a quick "del *.*"

worked fine for me then.. was a few years ago though!

Alternatively what about renaming it in dos or windows? guessing it won't like that either though.
 
From a DOS prompt in the directory type

dir /x

This will show you the the filenames in the old dos 8.3 naming format. Then type "del" followed by the "8.3 name" of the file.
 
Back
Top Bottom