How do I delete a file, which has quotation marks in the name, by CMD?

12

I'm deleting a folder from my hard drive and I was able to delete everything except this file.

Because it has quotation marks, I can not use short names, and I can not erase it the way it is.

I've tried fsutil file setshortname , but I can not keep the quotation marks in mai_68

I tried double quotation marks, \ , and other special characters like % , but the quotation marks are not recognized by the shell, as you can see:

    
asked by anonymous 28.03.2015 / 15:39

4 answers

7

Reserved characters

On Windows, there are some characters that are reserved because they serve a purpose when being used by the operating system:

  • < (less than)
  • > (greater than)
  • : (colon)
  • " (quotation marks)
  • / (slash)
  • \ (backslash)
  • | (vertical bar)
  • ? (question mark)
  • * (asterisk)

These characters are not allowed in file names or directories given to be reserved, but this does not mean that they will not be present in them, since many operating systems other than Windows allow its use.

Faced with files or directories that use these characters, it becomes difficult to solve the problem from a system that does not allow its use, so a solution passes using another operating system to rename or remove.

Solution

Fortunately, using another operating system these days requires no more than half a dozen minutes, such as Linux LiveCDs:

  • Download a Linux ISO ;
  • Download and run this or other software to create a boot PEN;
  • From the list of options, choose the correct distribution, if the link I left above, will be the option "Linux Mint";
  • Choose the ISO file of the distribution you downloaded;
  • Create the boot PEN.
  • Once created, just use it to boot with the computer, choose the option to "Experiment".

        
    29.03.2015 / 01:10
    2

    On the command line, and with the current directory where the files are, type:

    dir /x
    

    Thenameswrappedaroundtheorangeborderarethe8.3formatname.

    Withtheshortnameofthefile,youcandeleteit.

    Source: link

        
    28.03.2015 / 22:43
    1

    Windows does not recognize files that have special characters , so it understands that it is an invalid file. One way to remove these files is by running chkdsk . with the /f parameter.

    chkdsk o: /f
    

    Where O: is the partition where the invalid files are to be fixed. After the operation is finished, a folder named O:\found.000 will be created containing the file that can now be deleted.

    The 000 value may change depending on the amount of invalid files found.

    To delete, enter the folder found.000 (use cd LETRA to access the partition):

    >cd found.000
    

    Then delete all the arcs with the extension .chk :

    > del *.chk
    
        
    29.03.2015 / 00:33
    -1

    Try using the following:

    "\"meu_texto\""
    
        
    02.07.2015 / 02:46