Search code examples
sql-server-2008xp-cmdshell

Execute commands within tsql


How can I execute system command like dir other than xp_cmdshell?


Solution

  • I dont see any problem , here is an example :

    dstest is a remote server ...

    enter image description here

    edit

    run this to activate :

    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