windows - How to delete a file with quotes and spaces in the name without short name

08
2014-07
  • leventov

    The file doesn't have the short name (shown by del /x), answers here didn't help: How to delete a file that contains spaces in the file name?

    On attempt to del /F via pattern and \\?\ prefix it says "the filename,directory name, or volume label syntax is incorrect".

  • Answers
  • Mokubai

    When you want to completely delete a directory and it has file with long names inside it, robocopy does a VERY good job:

    mkdir empty_dir
    robocopy empty_dir the_dir_to_delete /s /mir
    rmdir empty_dir
    rmdir the_dir_to_delete
    
  • Mike Cloaked

    If you are in a bash shell then you can use the rm command and start to type the name of the file and then use tab to autocomplete the filename. This should easily allow you to get at the escaped spaces or quotes.


  • Related Question

    Is it safe to delete files in the WINDOWS\pchealth\ERRORREP\UserDumps\ folder?
  • Ryan Shripat

    I have files in C:\WINDOWS\pchealth\ERRORREP\UserDumps\ getting close to 100 MB each. Is it safe to delete them?


  • Related Answers
  • RJFalconer

    The PCHealth folder contains data as part of the Microsoft Help Center Service. The hdmp files are the large, uncompressed dumps from the crashing program. The mdmp files are the compressed dumps that are sent to microsoft.

    As these are just files being used for debugging, you can delete them all safely.

    If your userdumps folder continues to gain these files, then your system is having problems. Any application that crashes will leave these dump files. You will have to figure out the problem before these files will stop being created.

    Source