I believe you will also get that error if your $Directory has a space in it, like "c:\program files\yadayada".

Give this a shot

Code:

$shell = '%comspec% /c rd /s /q "' + $Directory + '" >nul'
shell $shell

_________________________
Eric