Ramon Quintana

Ramon Quintana

  • NA
  • 404
  • 65.9k

Access denied using XP_CMDSHELL

Sep 20 2018 3:18 PM
Hi, I tried to create a TXT file from SQL SERVER 2012 using "XP_CMDSHELL" but i got a msg "Access Denied"
 
Something like this:
 
DECLARE @cmd sysname, @var sysname;
SET @var = 'Hello world';
SET @cmd = 'echo ' + @var + ' > var_out.txt';
EXEC master..xp_cmdshell @cmd;
 
what´s could be wrong??

Answers (1)