DOS Switch Error

Posted on 2005-04-21
Last Modified: 2008-02-01
I'm trying to delete the contents of a directory from a DOS batch file like this:

del *.* f:\cemich\wwwroot /y

I get the error "invalid swtich".  I've tried it like this also:

del *.* /y f:\cemich\wwwroot

and get the same error.  What switch do I use to enable my batch program to delete the files in that directory without me being prompted during execution of the batch?
Question by:Remulac
    LVL 25

    Accepted Solution

    Do this:

       del f:\cemich\wwwroot\*.* /q
    LVL 25

    Assisted Solution

    Although, to be on the *safe* side, you should also add quotes, ie:

       del "f:\cemich\wwwroot\*.*" /q

    For more information on using the DEL command, at the Command Line, type:

       del /?

    LVL 25

    Expert Comment


    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    Move Profile Subfolders to new location 2 28
    Build VS2015 project in bat command 3 54
    strCount chalenge 3 35
    mapAB Challlenge 35 52
    You may have already been in the need to update a whole folder stucture using a script. Robocopy does it well and even provides a list of non-updated files in a log (if asked to). Generally those files that were locked by a user or a process by the …
    Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
    Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
    In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

    729 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

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now