window delete directory cmd code example Example: how to delete dir in windows cmd to remove an unempty file from cmd directory $ rmdir /S nonemptyfile