?
Solved

How to delete a folder using DOS command

Posted on 2013-06-29
6
Medium Priority
?
863 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
The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

 
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

Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

Question has a verified solution.

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

The article will include the best Data Recovery Tools along with their Features, Capabilities, and their Download Links. Hope you’ll enjoy it and will choose the one as required by you.
Healthcare organizations in the United States must adhere to the guidance of both the HIPAA (Health Insurance Portability and Accountability Act) and HITECH (Health Information Technology for Economic and Clinical Health Act) for securing and protec…
This video demonstrates basic masking and how to edit the mask to reveal the desired image.
This video will demonstrate how to find the puppet warp tool from the edit menu and where to put the points to edit.
Suggested Courses

771 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