I tried to avoid using xp_cmdshell but sometime I can't.
Most of time I used the xp_cmdshell for deleting the old backups because the drive got full and apps goes down. Once i had done I disabled it. (even scripts too)
The reason for using this some of the servers I don't have MSTSC access (OS level). Whatever the reason they didn't give(may be haven’t trust us).
Muthukkumaran Kaliyamoorthy
https://www.sqlserverblogforum.com/