xp_cmdshell在sql server中存储了proc

时间:2013-03-22 10:08:01

标签: java sql

我已将服务器映射到z:

所以,我试图使用以下命令使用sql server 2005中的xp_cmdshell存储过程断开此映射驱动器

exec sp_configure 'show advanced options', '1'
reconfigure
exec sp_configure 'xp_cmdshell','1'
reconfigure
exec xp_cmdshell 'net use z: /d /yes

我面临一个错误

network connection could not be found

但是,当我从命令提示符执行命令“net use z:/ d / yes”时,它的执行成功并且驱动器正在断开连接。

请告诉我“xp_cmd shell”存储过程中的问题是什么

1 个答案:

答案 0 :(得分:0)

尝试此命令

net use z: /d /y

你也可以尝试这个

 NET USE [driveletter:] /DELETE /Y