Sunday, February 8, 2015

cmd.exe - Delete a file that "does not exist" with a strange name


I've read about deleting files which "do not exist"


and got as far as del /q /s filename in command prompt.


However, the file is named COM^sv3.O[e in the browser.


but when i type in dir it = enter image description here


Of which there are charaters I cant even type.
Even copying from teh command prompt, as is. It still "cannot find" the file.


Any ideas on how to delete?


Answer



That backspace character can be a problem. Use the UNC path. Switch to the directory where the file is stored, then use this command:


del \\?\%cd%\COM^sv?3.0[e

Of course this is assuming that the filename shown in your screenshot is complete. If not, then just reduce it to del \\?\%cd%\COM*


Also, did you try simply deleting the file in Explorer?


No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...