Added directory support with the /d switch.