Help with Batch File

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • cori25
    New Member
    • Oct 2007
    • 83

    #1

    Help with Batch File

    I am backing up a file in a batch file but when I run the batch it stops in the middle asking whether the path is a directory or a file? How can I declare that it is a file so that it will not stop in the middle of executing?

    [PHP]@echo off
    :: variables
    set drive=M:\Field Ops\DailyOurVoi ce_BackUps
    set backupcmd=xcopy /f /s


    %backupcmd% "C:\Database\Da ily_Ourvoice\Da ta\181\Fri.xls" "%drive%\Fri(18 1).xls"[/PHP]
  • sierra7
    Recognized Expert Contributor
    • Sep 2007
    • 446

    #2
    Hi

    This is in the wrong Forum (Access) and I don't know anything about PHP, however you seem to be using the DOS command XCOPY (which copies multiple files) with the 'all sub-directories' switch '/s'

    It seems to me that the process is starting OK then finding another file in a sub-folder and trying to copy that to the same destination.

    I would drop the '/s' switch

    I would have used COPY not XCOPY

    I hope this helps

    S7

    Comment

    • cori25
      New Member
      • Oct 2007
      • 83

      #3
      Thanks for the info....I did the changes you mentioned and the batch now runs but does not save the file to the specified location

      Thanks

      Comment

      Working...