I'm new to command-line work and need to delete the directory D:softwarearch98 along with everything inside it. When I run `rmdir D:softwarearch98`, I get a message saying the directory isn't empty. This is part of a training lab that restricts me to commands such as rmdir, attrib, cd, dir, and mkdir, so I may not be allowed to use other PowerShell cmdlets.
3 Answers
First verify that the path exists and that you're typing it exactly as shown with `dir D:software`. If the files are hidden or read-only, list them with `dir /a`; the lab may expect you to use `attrib` to clear those attributes before removing the directory. Also make sure you're running the command in the environment the exercise requires, since PowerShell and Command Prompt interpret switches differently.
In PowerShell, `rmdir` is normally an alias for `Remove-Item`, so the PowerShell form would be `Remove-Item -Path 'D:softwarearch98' -Recurse -Force`. However, if the exercise only permits the listed commands, it may specifically expect the Windows-style `rmdir /s` syntax rather than this cmdlet.
If the lab is expecting the traditional Windows `rmdir` command, use the recursive option: `rmdir /s D:softwarearch98`. Add `/q` if the lab allows it and you want to skip the confirmation prompt: `rmdir /s /q D:softwarearch98`. The `/s` switch is what tells it to remove the files and subdirectories too.

Related Questions
Can't Load PhpMyadmin On After Server Update
Redirect www to non-www in Apache Conf
How To Check If Your SSL Cert Is SHA 1
Windows TrackPad Gestures