General
cancel
Showing results for 
Search instead for 
Did you mean: 

Powershell command equivalent to deltree /y ?

SOLVED
Go to solution
Daniel Simard
Frequent Advisor

Powershell command equivalent to deltree /y ?

Hi All,
I cannot find for the life of me a command equivalent to deltree /y we used to use back in the old days.

there's

rd /s
etc... but it always states that it cannot delete a folder if it is not empty.

How do you delete (through command-line) a folder that is not empty in DOS on server 2008? or if you have a vbscript etc..
Si tu n'as pas ce que tu aimes, aimes ce que tu as.
2 REPLIES
Mayur Jain
Occasional Visitor
Solution

Re: Powershell command equivalent to deltree /y ?

Hi Daniel,
I tried the option
rd /s /q
rd c:\WINDOWS\Temp\Test /s /q
It worked perfectely fine on windows XP system. The "test" folder had empty folders and few files and it cleaned all.
Jon Finley
Honored Contributor

Re: Powershell command equivalent to deltree /y ?

And...

DEL /F /S /Q foldername

Still works.

Power Shell

Get-Help Remove-Item -full

Remove-Item C:\Windows -recourse

Should delete all files and remove all sub-folders within the Windows folder.

Jon
"Do or do not. There is no try!" - Yoda