Delete several strange folders just now

Source: Internet
Author: User

In the Internet cafe a few days ago, use flashget to download msdn webcast and save it to a new folder.

Go home and open it. You can see that each folder has two identical names. The two folders with the same strange names exist in one folder.

Go to the folder and find that the downloaded items are invisible... a headache.

There is no way to delete one of the two folders with the same name, and then enter another folder, and find that the downloaded content appears.

The files inside cannot be opened directly. However, the files can be copied out. The files are returned, but the remaining directories cannot be deleted.

Helpless! Prepare to keep these folders, copy other files, and format the hard disk! A gb hard disk is filled with headaches ..

I saw an article in the blog that day.Article<A bug almost caused the file system on the server to crash.>. In the command line, enter

> RD/s \\? \ L: \ modern C # series courses

RD/s \\? \ L: \ intel processor platform development series courses

Actually deleted.

Although my folder does not end with a space, it is strange! This method is not only used to delete folders with spaces.

Thanks again


Windows command line tools del and RD support one way to check the validity of the input file name, which is to add\\? \

For example

Del "\? \ C: \ temp \ XXX. "delete XXX. This file

Delete a directory

RD/s "\? \ C: \ temp \ XXX. "delete the XXX. Directory

After executing this command, you can delete these weird files. Note: You must enter the complete directory. The relative path is not supported.

Create a directory with spaces:

String dir = @ "C: \ temp \ ABC ";
System. Io. Directory. createdirectory (DIR); // create the ABC directory under the c: \ Temp Directory
String dir1 = @ "C: \ temp \ BCD \";
System. Io. Directory. Move (Dir, dir1); // move ABC to the "BCD" directory. Note that there is a space behind BCD.
Catch (exception ex)
MessageBox. Show (ex. message, "error", messageboxbuttons. OK, messageboxicon. Error );

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.