Home My Account Register Domain Transfer Domain Contact Us Whois Documentation
Forum Home Forum Home > Information Technology > HĐH Windows
  New Posts New Posts RSS Feed: How To Enable Xp_CmdShell in Sql Server?
  FAQ FAQ  Forum Search   Register Register  Login Login
If this is your first visit, be sure to check out theForum by clicking the link above. You may have toregister before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.
ASG Vietnam

How To Enable Xp_CmdShell in Sql Server?

 Post Reply Post Reply
admingroup View Drop Down


Joined: 14 October 2005
Online Status: Offline
Posts: 508
  Quote admingroup Quote  Post ReplyReply Direct Link To This Post Topic: How To Enable Xp_CmdShell in Sql Server?
    Posted: 20 September 2012 at 13:25

Today I will show you how to enable the Xp_CmdShell extended stored procedure in Sql Server 2005 and 2008.
Well normal error message you'll get when Xp_CmdShell is not enabled on your Sql Server and you to try execute some Windows commands using Xp_CmdShell is

Msg 15281, Level 16, State 1, Procedure xp_cmdshell, Line 1
SQL Server blocked access to procedure 'sys.xp_cmdshell' of component 'xp_cmdshell' because this component is turned off as part of the security configuration for this server. A system administrator can enable the use of 'xp_cmdshell' by using sp_configure. For more information about enabling 'xp_cmdshell', see "Surface Area Configuration" in SQL Server Books Online.

You can enable the Xp_CmdShell using 2 ways, either by executing T-sql statements or from
"Surface Area Configuration Manager". We'll see both of them.

A. Enable Xp_Cmdshell from Management Studio.
For enabling Xp_CmdShell from Management Studio you need to execute following code.

-- To allow advanced options to be changed.
EXEC sp_configure 'show advanced options', 1
-- To update the currently configured value for advanced options.
-- To enable the feature.
EXEC sp_configure 'xp_cmdshell', 1
-- To update the currently configured value for this feature.

B. Enable the Xp_CmdShell from "Surface Area Configuration Manager."

1. Click Start, point to Programs, point to Microsoft SQL Server 2005, point to Configuration Tools, and then click SQL Server Surface Area Configuration.
2. On the SQL Server 2005 Surface Area Configuration page, click Surface Area Configuration for Features.
3. Click on xp_cmdshell and tick on checkbox of "Enable the xp_cmdshell".

  Share Topic     
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

This page was generated in 0.109 seconds.
[Free Express Edition]
Copyright ©2001-2009 Web Wiz
Support: raovatphanmem Support: Info hanoi software
Online(s): 128.
Visitors Counter:37980993, AVERAGE/day(3719) is: 10213
Begin count is day 02/16/2009

You are browsing this site with: CCBot/2.0 (
Your IP address is:
The DNS lookup of the IP address is:
The method used to call the page: GET
The server's domain name:
The link
BaoKyNam Viêm gan b Thẩm mỹ viện Hoa Kỳ