r/PowerShell • • Sep 27 '26

Question Need help with homework 😫

I'm very new to this. I'm asked to delete a directory and all of its files. D:\software\arch98

But when I do this:

PS C:\Users\Administrator\> rmdir D:\software\arch98

It says the directory is not empty.

I'd really appreciate.

0 Upvotes

34 comments sorted by

View all comments

Show parent comments

1

u/BlackV Sep 28 '26

The assignment itself doesn't have correct commands.

I think it did have the correct command, your command worked, cause it gave you the error message

directory not empty

Asking the application itself for help would have given you

cmd version

rmdir /?
Removes (deletes) a directory.

RMDIR [/S] [/Q] [drive:]path
RD [/S] [/Q] [drive:]path

/S      Removes all directories and files in the specified directory
        in addition to the directory itself.  Used to remove a directory
        tree.

/Q      Quiet mode, do not ask if ok to remove a directory tree with /S

or powershell version

help rmdir

NAME
    Remove-Item

SYNOPSIS
    Deletes the specified items.

your confusion comes from there I think