# Enabling xp\_cmdshell in SQL Server 2005

**URL:** <https://forums.thehomestack.io/t/enabling-xp-cmdshell-in-sql-server-2005/306>\
**Category:** Databases\
**Created:** [September 5, 2008, 2:15pm UTC](https://forums.thehomestack.io/t/enabling-xp-cmdshell-in-sql-server-2005/306 "2008-09-05T14:15:46Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://forums.thehomestack.io/uploads/default/original/1X/161426793bc0d8bdf0d1a6692b3e44446861cc72.jpeg) [@system](https://forums.thehomestack.io/u/system)\
**Post date:** [September 5, 2008, 2:15pm UTC](https://forums.thehomestack.io/t/enabling-xp-cmdshell-in-sql-server-2005/306/1 "2008-09-05T14:15:46Z")

</div>

By default, xp\_cmdshell is disabled in SQL Server 2005 for security reasons. I am currently using xp\_cmdshell in my backup stored procedure to delete files, so I must enable xp\_cmdshell on my SQL Server 2005 instances. There are two ways to enable this option: Surface Area Configuration tool or sp\_configure. Enabling this option via Surface Area Configuration tool is rather straight forward. Here is the script to enable xp\_cmdshell in SQL Server 2005 via sp\_configure:

EXEC master.dbo.sp\_configure ‘show advanced options’, 1

RECONFIGURE

EXEC master.dbo.sp\_configure ‘xp\_cmdshell’, 1

RECONFIGURE
