如何在查询分析器中执行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;

posted @ 2009-02-10 14:56  *新*新*  阅读(571)  评论(0编辑  收藏  举报