XP_CMDSHELL

  • I am running the statement

    exec xp_cmdshell 'copy /Y \\servername\sharename\file d:\directoryname'

    when I run this command it take a second to run, does not copy the file and has an output of

    1. Access id denied

    2. NULL

    both shares and directory have permissions of everyone full control

    All I am trying to do is copy a file from a share onto the d: of the server

    can anyone help

  • What account is SQL Server starting up as?

    If it is the localsystem account, then it has no network access, regardless of permissions.

  • Try this.

    exec xp_cmdshell 'copy "\\org_servername\sharename\filename" "\\dest_servername\sharename\directoryname\"'

  • what I have done is this

    exec xp_cmdshell 'net use x: \\servername\share password /user:domain\administrator', NO_OUTPUT

    exec xp_cmdshell 'copy /Y X:\file.xls d:\directoryname', NO_OUTPUT

    exec xp_cmdshell 'net use x: /del', NO_OUTPUT

    it seems to work thanks for you help

    Paul

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply