Announcement

Collapse
No announcement yet.

Unable to Copy or Move through Script

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Unable to Copy or Move through Script

    I am trying to either move or copy (then del) a file from the local drive to a network share through a batch script. The script is run in an application over psexec using credentials that has write access to the share folder. Also, the file names are unique enough not to require overwrite.

    move c:\*xxx*.ext \\network-share\folder\
    xcopy c:\*xxx*.ext \\network-share\folder\

    But, none of this works even though it works (as expected) interactively.

    Ideas?

    Thanks.

  • #2
    Re: Unable to Copy or Move through Script

    One quick think to try before others give there ideas.

    I have had a issue with scripts and UNC paths before, if you net use the share to a drive letter (example z then change the script below to:

    move c:\*xxx*.ext z:
    xcopy c:\*xxx*.ext z:

    does that work ?

    Comment


    • #3
      Re: Unable to Copy or Move through Script

      Does the destination path name have spaces in it? If so, you'll need to surround the path in quotes.

      Comment


      • #4
        Re: Unable to Copy or Move through Script

        Originally posted by parklabel View Post
        none of this works even though it works (as expected) interactively.
        Maybe a credential problem. Does the script work if you launch psexec with the -u username -p password switches?

        You could redirect script output to log file and watch for any errors.

        -vP

        Comment


        • #5
          Re: Unable to Copy or Move through Script

          Originally posted by vonPryz View Post
          Maybe a credential problem. Does the script work if you launch psexec with the -u username -p password switches?

          You could redirect script output to log file and watch for any errors.

          -vP

          Well, I run cmd.exe with the authorized credential and then run everything without the -u switch off of there and this works for everything...well almost everything until now. When I added the -u switch (even though it is redundant), it was able to both move and copy.

          Thanks very much!

          Comment

          Working...
          X