如何在查询分析器中执行dos命令

---打开cmd开关 

exec sp_configure 'xp_cmdshell','1';

RECONFIGURE;

---通过xp_cmdshell执行dos命令

exec xp_cmdshell 'del d:\test.txt';

---关闭开关exec sp_configure 'xp_cmdshell','1';

RECONFIGURE;

原文地址:https://www.cnblogs.com/shined/p/1387467.html