For users that are not members of the sysadmin role on the SQL Server instance you need to do the following actions to grant access to the xp_cmdshell extended stored procedure.
*A system administrator can enable the use of 'xp_cmdshell' by using sp_configure.*
Enable the xp_cmdshell procedure:
EXEC sp_configure 'show advanced options', 1 RECONFIGURE GO EXEC sp_configure 'xp_cmdshell', 1 RECONFIGURE GO
Grant EXEC permission on the xp_cmdshell stored procedure:
GRANT EXECUTE ON xp_cmdshell TO [Domain\TestUser]
To do it yourself you need serveradmin or sysadmin privileges privs for that