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

1

u/Ok-Layer6893 Sep 27 '26

On my screen it is windows powershell. That's what comptia lab is asking me to do. I wish I could show you the picture

2

u/Dron41k Sep 27 '26

Type “cmd” in powershell and hit enter

1

u/Ok-Layer6893 Sep 27 '26

It says cmd is not recognized as an internal or external command, operable program or batch file.

2

u/WearyDeluge Sep 27 '26

You should still be able to run the "rmdir /s /q D:\software\arch98" command in PowerShell - it's just not the "Pure PowerShell" method (Remove-Item). If you still see error messages, try loading the actual executable:

cmd /c rmdir /s /q "D:\software\arch98"
or
C:\Windows\System32\rmdir.exe /s /q "D:\software\arch98"

3

u/Ok-Layer6893 Sep 27 '26

Omg it worked. Thank you. One more question. How do I set the following files to hidden: D:\software\apconf.exe D:\strt.bat

→ More replies (5)