How to delete a file that contains a backslash in the name under Windows 7?

Posted by espinchi on Super User See other posts from Super User or by espinchi
Published on 2012-04-06T18:23:47Z Indexed on 2012/04/06 23:34 UTC
Read the original article Hit count: 186

Filed under:
|

I want to delete a file named workspaces\google-gson-1.7.1-release.zip Yep, it contains a backslash in the name.

Here it is:

G:\>dir Z_DRIVE
 Volume in drive G is samsung
 Volume Serial Number is 48B9-7E1D

 Directory of G:\Z_DRIVE

04/06/2012  08:09 PM    <DIR>          .
04/06/2012  08:09 PM    <DIR>          ..
05/01/2011  02:21 PM           528,016 workspaces\google-gson-1.7.1-release.zip
           1 File(s)        528,016 bytes
           2 Dir(s)  88,400,478,208 bytes free

The first attempt is to just delete it from the Windows Explorer, but it says it can't find the file.

Then, I tried from the command line:

G:\>del Z_DRIVE\workspaces\google-gson-1.7.1-release.zip
The system cannot find the file specified.

And, after researching a bit in the internets, I also tried the following, with no luck:

G:\>del \\?\G:\Z_DRIVE\workspaces\google-gson-1.7.1-release.zip
The system cannot find the file specified.

Other than booting from some Linux CD, is there a way to get rid of this file?

Update: also tried the following combinations, but the error is the same:

G:\>del "\\?\G:\Z_DRIVE\workspaces\google-gson-1.7.1-release.zip"
G:\Z_DRIVE>del workspaces\google-gson-1.7.1-release.zip
G:\Z_DRIVE>del "workspaces\google-gson-1.7.1-release.zip"
G:\Z_DRIVE>del workspaces*google-gson-1.7.1-release.zip

© Super User or respective owner

Related posts about windows-7

Related posts about command-line