0

Completely by accident, I created a file named ... using Grunt.js for Node in Windows 8.

Is it possible to remove this file without having to reformat the partition?

5
  • 3
    Yes, it is. It can probably be done with Explorer (it has been a long time since I have seen an unlocked file Explorer can't delete). Failing that, cmd.exe should be able to handle it okay - see delete. If both of those fail, grab mingw or cygwin and delete it. But, not programming related ...
    – user2246674
    Apr 30, 2013 at 6:39
  • 1
    What did you try to remove it and what failed?
    – Jan Doggen
    Apr 30, 2013 at 8:57
  • Loss of similar questions, such as superuser.com/questions/282194, superuser.com/questions/554072 etc. Also see support.microsoft.com/kb/320081.
    – Karan
    Apr 30, 2013 at 15:07
  • @pnuts: None of the linked questions is about a Linux issue. Basically all questions of this type are similar IMO. The problem is that the GUI restricts the filenames/characters that can be used, but the underlying file system itself doesn't. Thus when you somehow end up with 'invalid' filenames you're stuck unless you use the alternate syntax that bypasses the normal checks, or use another OS such as Linux. (P.S. In my comment above obviously Loss = Lots.)
    – Karan
    Apr 30, 2013 at 16:33
  • @pnuts: I used 'similar' in the sense that the reason for the issue is most likely the same, and so are the solutions. Anyway why the excessive quibbling and hair-splitting? If you notice I didn't choose to mark this question as a dupe of any of the others.
    – Karan
    Apr 30, 2013 at 16:52

2 Answers 2

4

Run cmd.exe and type del \\?\absolutepath. So if the filename is C:\tmp\... then type del \\?\C:\tmp\....

Giving the \\?\ prefix makes the program use the Unicode version of the Windows file functions. These can handle more filenames than the ANSI versions. The Unicode version for example allows you to create or delete files named CON, PRN or NUL which are old filenames which still have special meaning in Windows.

0
0

in addition to user2246674 and pnuts answer, I recommend you get "Unlocker" for Windows . It's a nifty little gadget - easy to download, install and use. All of my machines run it. If you have installed it onto your machine in Windows, simply right click the file and then choose "Unlocker" from the menu and then select "Delete" in the left menu options and click on OK.

This tool is quite useful even if something is writing to the file and has accessed it. It will UNLOCK it and you can delete it.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .