Java xp\u cmdshell在sql server中存储的过程
我已将服务器映射到z: 因此,我尝试使用xp_cmdshell存储过程,使用下面的命令,从sql server 2005断开此映射驱动器的连接Java xp\u cmdshell在sql server中存储的过程,java,sql,Java,Sql,我已将服务器映射到z: 因此,我尝试使用xp_cmdshell存储过程,使用下面的命令,从sql server 2005断开此映射驱动器的连接 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 coul
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\u cmd shell”存储过程有什么问题,请尝试此命令
net use z: /d /y
你也可以试试这个
NET USE [driveletter:] /DELETE /Y
“如果您不想显示任何内容,请尝试net use*/d/y>nul”在您的案例中,net use z:/d/y>nulI已经尝试了所有类型,如“/d/y”、“/delete/y”、“/delete/yes”、“/d/yes”。它们都没有在存储过程中工作,但是thorugh cmd提示它们正在工作