title: Access denied when trying to move files with xp_cmdshell
body: <p>Im trying to use some T-SQL to move some files from one directory to another.
  Im using xp_cmdshell to call the move command
  Just like this:</p>
  
  <pre><code>create table #output(line varchar(2000) null)
  insert into #output exec master..xp_cmdshell 'move /y "D:\files\*.txt" "D:\oldfiles"'
  </code></pre>
  
  <p>But the files inst move and the #output table contains this output from the move command</p>
  
  <pre><code>Access is denied.
  Access is denied.
  Access is denied.
  Access is denied.
  Access is denied.
  Access is denied.
          0 file(s) moved.
  NULL
  </code></pre>
  
  <p>The sql server proxy account is mapped to the local administrator
  If i open a command prompt at enter the move command</p>
  
  <pre><code>move /y "D:\files\*.txt" "D:\oldfiles"
  </code></pre>
  
  <p>The files are moved perfectly</p>
  
  <p>Its all happening on a sql2005 running on a w2k3 server.</p>
  
  <p>Im logged into the server as local administrator</p>