DeleteOutputFolder
is an option of DcmToNii. If the ouput folder already exists it will be deleted.
"XXXX"