Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

DOS - Simple DEL command

Options
  • 28-01-2004 6:24pm
    #1
    Registered Users Posts: 841 ✭✭✭


    What command will delete all files and folders below the current working directory with no prompts or questions?
    Here's what I have but it doesn't seem to delete the actual directories themselves (just the files):
    del /s/q/f *.*


Comments

  • Banned (with Prison Access) Posts: 16,659 ✭✭✭✭dahamsta


    Don't use the prompt much in Windows, but this looks promising.

    adam


  • Registered Users Posts: 3,777 ✭✭✭Nuttzz


    AFAIK you cant use a wildcard to delete a directory you have to name it

    see del /?


  • Closed Accounts Posts: 545 ✭✭✭ColmOT [MSFT]


    del /s /q *.*


  • Registered Users Posts: 841 ✭✭✭Dr Pepper


    Thanks guys,
    Yeh, I nearly had it. Seems like the 'del' command only deletes files and I have to use the 'rmdir' command with /s (include subdirs) to delete all directories aswell.

    So, to whom it may concern.. to delete all files and folders in c:\test..

    [C:\ prompt]... rmdir c:\test /s/q

    /s - include subdirectories
    /q - quiet mode, do not ask 'Are you sure you want to yada yada yada?'


    <edit>According to that site, the commands are a little different in 2000 and XP which is probably why 'del...' didn't work fully!


  • Moderators, Recreation & Hobbies Moderators, Science, Health & Environment Moderators, Technology & Internet Moderators Posts: 91,802 Mod ✭✭✭✭Capt'n Midnight


    Remember good old DELTREE /Y filename
    from DOS - may still work on FAT32 volumes in XP cmd prompt.

    Yes M$ keep changing commands and switches, this makes a lot of your intellectual property worthless.


  • Advertisement
  • Closed Accounts Posts: 545 ✭✭✭ColmOT [MSFT]


    Yeah, it's a pity Deltree has been retired. It's one of the commands that I used to find very useful.

    As far as I remember, deltree was only available in MS-DOS.
    (The command interpreter in Windows NT, W2K, XP & WS03 is not MS-DOS.)

    But a del /s /q does the same thing.


  • Moderators, Recreation & Hobbies Moderators, Science, Health & Environment Moderators, Technology & Internet Moderators Posts: 91,802 Mod ✭✭✭✭Capt'n Midnight


    not quite - DEL /Q /S *.*
    deletes all files - but does not remove folders

    Deltree.exe (win98se) works at the command prompt in XP ;)


    Also have a look at lcopy - long filename name utils for FAT 16/32 in "DOS MODE" ie will work off a boot disk - see stickies.


  • Closed Accounts Posts: 545 ✭✭✭ColmOT [MSFT]


    You're right.

    it's RD /s /q <folderName> that delete folders & subfolders.


  • Moderators, Recreation & Hobbies Moderators, Science, Health & Environment Moderators, Technology & Internet Moderators Posts: 91,802 Mod ✭✭✭✭Capt'n Midnight


    RD /S /Q
    - and it works in NT4 too
    - ya learn something new every day


Advertisement