现在的位置: 首页 > 综合 > 正文

打开sqlserver数据库 xp_cmdshell功能,并映射网络驱动器

2012年01月20日 ⁄ 综合 ⁄ 共 573字 ⁄ 字号 评论关闭

1. 打开sqlserver数据库 xp_cmdshell功能

  -- To allow advanced options to be changed.

  EXEC sp_configure 'show advanced options', 1

  GO

  -- To update the currently configured value for advanced options.

  RECONFIGURE

  GO

  -- To enable the feature.

  EXEC sp_configure 'xp_cmdshell', 1

  GO

  -- To update the currently configured value for this feature.

  RECONFIGURE

  GO

  -- To disallow advanced options to be changed.

  EXEC sp_configure 'show advanced options', 0

  GO

  -- To update the currently configured value for advanced options.

  RECONFIGURE

  GO

2. 映射网络驱动器

  exec   master..xp_cmdshell   'net   use   z:  \\192.168.0.2  password  /user:username'

抱歉!评论已关闭.