Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 143789
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T08:09:03+00:00 2026-05-11T08:09:03+00:00

Im trying to use some T-SQL to move some files from one directory to

  • 0

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:

create table #output(line varchar(2000) null) insert into #output exec master..xp_cmdshell 'move /y 'D:\files\*.txt' 'D:\oldfiles'' 

But the files inst move and the #output table contains this output from the move command

Access is denied. Access is denied. Access is denied. Access is denied. Access is denied. Access is denied.         0 file(s) moved. NULL 

The sql server proxy account is mapped to the local administrator If i open a command prompt at enter the move command

move /y 'D:\files\*.txt' 'D:\oldfiles' 

The files are moved perfectly

Its all happening on a sql2005 running on a w2k3 server.

Im logged into the server as local administrator

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T08:09:03+00:00Added an answer on May 11, 2026 at 8:09 am

    Can you run a ‘who am I?’ command, like this:

    exec master..xp_cmdshell 'whoami' 

    and tell what this returns?

    EDIT:

    • By the OP’s comment, the commands are run as NETWORK SERVICE. Allowing NETWORK SERVICE on the directory in question solved the problem.

    • ‘Modify’ permissions are sufficient for file changes.

    • If the file is on a network share instead of a local drive, make sure that the sufficient permissions are set on the share itself as well. File permissions are checked after share permissions, so if the file allows ‘Modify’, but the share only allows ‘Read’, the overall permissions will still be ‘Read’.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to use SQL Server Profiler (2005) to track down some application performance
I'm trying to use some data from a PlanPlusOnline account. They only provide a
I am trying to use some pinvoke code to call a C function. The
I'm trying to insert some data into SQL from Excel VBA. The SQL commands
I could use some help writing a SQL query. I'm trying to display some
I'm trying to generate some sql files in my java application. The application will
Im facing a strange issue trying to move from sql server to oracle. in
Question. I'm trying to use SQL to update a listview in C#. Using the
I'm trying to move a SQL Server database from webfusion to heartinternet. It was
I am trying to replicate some SQL functionality using ActiveRecord. My problem relates to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.