T-SQL筆記47_RECONFIGURE時候出現_不支援針對系統目錄進行特定更新

declare @Text as nvarchar(1500)  
declare @Cmd  as nvarchar(1000)  

set @Text = ' hello world this is a text send by t-sql'  
set @Cmd  ='echo ' +  @Text + ' > C:\Test.txt' 


execute ..xp_CmdShell  @Cmd


由於嘗試要在t-SQL中做寫檔功能
需開啟xp_CmdShell  權限
起初嘗試的腳本
EXEC sp_configure 'show advanced options', 1;
    RECONFIGURE;
    EXEC sp_configure 'xp_cmdshell', 1;
    RECONFIGURE;

修改後的腳本

EXEC sp_configure 'show advanced options', 1;
    RECONFIGURE WITH OVERRIDE;
    EXEC sp_configure 'xp_cmdshell', 1;
    RECONFIGURE WITH OVERRIDE;

終於顯示
組態選項 'show advanced options' 從 1 變更為 1。請執行 RECONFIGURE 陳述式來安裝。
組態選項 'xp_cmdshell' 從 0 變更為 1。請執行 RECONFIGURE 陳述式來安裝。

OK結束這一回合

Ref:
渗透之——SQL Server启动/关闭xp_cmdshell

xp_cmdshell關閉開啟語法與已封鎖元件 'Ad Hoc Distributed Queries'

xp_cmdshell SQL Server 2012: How to create a text file with "< , >" characters in it?

RECONFIGURE 時出現不支援針對系統目錄進行特定更新

留言

這個網誌中的熱門文章

經得起原始碼資安弱點掃描的程式設計習慣培養(五)_Missing HSTS Header

經得起原始碼資安弱點掃描的程式設計習慣培養(三)_7.Cross Site Scripting(XSS)_Stored XSS_Reflected XSS All Clients

(2021年度)駕訓學科筆試準備題庫歸納分析_法規是非題