Tech or Treat! Write an article about your scariest tech disaster to win gadgets!Learn more

x
?
Solved

How to delete a folder using DOS command

Posted on 2013-06-29
6
Medium Priority
?
867 Views
Last Modified: 2013-06-30
Anybody can give me a step by step DOS command to delete a folder Name 1    in C drive
Screen.docx
0
Comment
Question by:kianhow
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 19

Assisted Solution

by:Rikin Shah
Rikin Shah earned 900 total points
ID: 39287650
Hi,

Use this command-
rmdir c:\1 /s
0
 
LVL 14

Accepted Solution

by:
Tribus earned 300 total points
ID: 39287685
"rd" and "deltree" also are good commands

Use:

rd dirname /q /s
deltree dirname

rd and rmdir without the /s will not work if there are files or other objects in the directory. The /q is to run in quiet mode while using /s

deltree is the "correct" way to delete directories that contain files or other objects.  Use /y with deltree to suppress the confirmation prompt.

The exact command for what you are asking for in the question with deltree is:

deltree c:\1 /y

Open in new window


You may need to run your DOS box as administrator in some cases.
0
 
LVL 43

Assisted Solution

by:Steve Knight
Steve Knight earned 300 total points
ID: 39287805
Unless you are actually using DOS or very old OS DELTREE is not the right way.

If this is command prompt in XP, Windows 7 etc. then rmdir (or short of same command rd) is right as with the first post.  be careful of course, I don''t suggest CD into a folder then RD as if the CD fails because the dir doeesnt exist it would remove your current dir.

you may also want to add the /q prompt to supress the question.
steve
0
Survive A High-Traffic Event with Percona

Your application or website rely on your database to deliver information about products and services to your customers. You can’t afford to have your database lose performance, lose availability or become unresponsive – even for just a few minutes.

 
LVL 14

Assisted Solution

by:Tribus
Tribus earned 300 total points
ID: 39287808
The OP never mentioned Windows at all in the post/tags, so I answered with strict DOS thinking...or did I show my age...
0
 
LVL 43

Assisted Solution

by:Steve Knight
Steve Knight earned 300 total points
ID: 39287877
Fair enough.... the picture is a Office 2007+ screen shot of a Windows 64 bit machine though :-)

(Oh and DOS was new fangled when I started using it, nothing useful like a DELTREE command to start with...)
0
 

Author Closing Comment

by:kianhow
ID: 39288130
bb
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Ever wonder what it's like to get hit by ransomware? "Tom" gives you all the dirty details first-hand – and conveys the hard lessons his company learned in the aftermath.
Here in this article, you will get a step by step guidance on how to restore an Exchange database to a recovery database. Get a brief on Recovery Database and how it can be used to restore Exchange database in this section!
XMind Plus helps organize all details/aspects of any project from large to small in an orderly and concise manner. If you are working on a complex project, use this micro tutorial to show you how to make a basic flow chart. The software is free when…
This video Micro Tutorial shows how to password-protect PDF files with free software. Many software products can do this, such as Adobe Acrobat (but not Adobe Reader), Nuance PaperPort, and Nuance Power PDF, but they are not free products. This vide…

647 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question