why dont you use the deltree command in DOS then call the kix script from within DOS to execute the remaing code.