Solved

How to delete a folder using DOS command

Posted on 2013-06-29
6
861 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 300 total points
ID: 39287650
Hi,

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

Accepted Solution

by:
Tribus earned 100 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 100 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
Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

 
LVL 14

Assisted Solution

by:Tribus
Tribus earned 100 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 100 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Visual C# Windows Project - Clone Form 4 35
ComboBox to String Not Working 5 39
What are MicroServices? 4 64
Weather Channel Nag Sreen Problem 6 35
In this article, you will read about the trends across the human resources departments for the upcoming year. Some of them include improving employee experience, adopting new technologies, using HR software to its full extent, and integrating artifi…
There are many software programs on offer that will claim to magically speed up your computer. The best advice I can give you is to avoid them like the plague, because they will often cause far more problems than they solve. Try some of these "do it…
The viewer will learn how to set up a document for the web and print and the recommended PPI for printing.
This video will demonstrate how to find the puppet warp tool from the edit menu and where to put the points to edit.

740 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