Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have created a folder via php but I made a mistake since I forgot to clear spaces. Now I cannot delete this folder.

I have made a research - look at the second answer (Quoted below) but I don't know how to rename a folder with 7-zip.

I had the same problem, in Windows 7 x64, and none of the command-line solutions worked here. What fixed it for me: •Rename the folder using 7-Zip •Delete, either using 7-Zip or Explorer (both work). Note that deleting the folder in 7-Zip before renaming it was impossible.

I also tried the command line, but it does not work. My folder is named " 1 ".

I downloaded 7z, and Google does not provide the help I need.

Thank you.

share|improve this question
    
Try my new suggestion in my answer. –  BloodPhilia Mar 13 '13 at 15:44
    
Folder names that start and end with spaces shouldn't be a problem on Win7. I was able to create a folder named " 1 " and then delete without problem using just the mkdir and rmdir commands built into cmd.exe. Is it possible the name contains other characters? E.g., are those double quotes part of the name or is it possible those spaces aren't spaces and displaying as spaces? –  Nicole Hamilton Mar 13 '13 at 16:39

4 Answers 4

up vote 1 down vote accepted

Find the item you want renamed in the main window. Then right click the file/folder in the list and click "rename".

You could also select it by clicking it once and press F2.

Edit:

Try this from the commandline:

rename "\\?\c:\<PATH HERE>\[ ]1[ ]" "<NEW FILE NAME>"

or

rename "\\?\c:\<PATH HERE>\ 1 " "<NEW FILE NAME>"

Mind you, the NEW FILE NAME doesn't take the full path, so just use the file's name. PATH HERE is just the path without the file.

share|improve this answer
    
With the first example : not found - With the second : incorrect syntax - Should I do it from the root ? –  Ocelote Mar 13 '13 at 15:49
    
@Ocelote can you post the commands you used as a comment? –  BloodPhilia Mar 13 '13 at 15:50
    
I used cd to go to images, and from there : \\?\C:\Websites\education-fonctionnelle\images\[ ]1[ ]" "2" => not found. \\?\C:\Websites\education-fonctionnelle\images\ 1 " "2" => incorrect syntax –  Ocelote Mar 13 '13 at 15:55
    
@Ocelote, after the NEW FILE NAME, you should end with a ". I don't see this in your comment, did you use this? so: \\?\C:\Websites\education-fonctionnelle\images\[ ]1[ ]" "2" –  BloodPhilia Mar 13 '13 at 15:56
1  
I managed to do it again. For whoever passes by here try the command lines above. I also tried rd "\\?\C:\Websites\education-fonctionnelle\images\[ ]1[ ]" "2" (which is not correct but still, it is part of what I did) THANK YOU !!!!!!! –  Ocelote Mar 13 '13 at 16:22

Are you using Windows 7? Try to do a chkdsk /f on the affected drive. It should correct illegal filenames (beware: it will move the files to a FOUND.000 folder on the root)

share|improve this answer

Just had the same problem. After using a renaming utility, I discovered that I had 4 files that had a leading space. Tried renaming it, windows coughed and said that the names couldn't be changed. I decided to add a character (in my case I just typed "1") in front of the leading space and I could save it (renamed). I then could rename the file by removing the character (again, in my case I just added a "1") and the aforementioned leading space without any problems.

share|improve this answer

I had two files, one with a space at the end, and the other with a period at the end. Windows refused to allow me to rename or delete either. I tried doing it through Python's os module, as well, to no avail. The solution that finally worked for me was to open a command prompt (cmd.exe), cd to the folder, and then run the command:

del *.*

Of course, this means moving everything you want to keep out of the folder first.

EDIT: Sorry, reread the question and realized you are talking about a folder, not a file, so my answer really doesn't help you, but I'm going to leave it here for anyone else who has similar issues.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.