Results 1 to 4 of 4

Thread: Copy the latest file to a network server directory using a Batch file

  1. #1

    Copy the latest file to a network server directory using a Batch file

    Can someone help why the code below does not work? I am trying to copy the latest file to move to a network server. I keep getting a invalid parameter. I am trying test the code in a batch file to see if works or not to move the code in a SQL server job to run to get my backup file copy to a network server.

    echo off
    FOR /F "tokens=1-4 delims=/ " %%I IN ('DATE /t') DO SET mydate=%%I%%J%%K%%L
    xcopy "E:\backup\*.bak" "\\Test_server\E$\Test_backp\*.bak" /D:%mydate%
    echo %mydate%

  2. #2
    Junior Member
    Join Date
    Aug 2009
    Look here:

  3. #3
    Junior Member
    Join Date
    Jun 2009

    Finding the latest file and copying

    Take a look the script latest.txt posted at toward the bottom of the page. You can use that script to find the latest file, then use the system copy command to copy the file.


  4. #4
    Elite Member TonyT's Avatar
    Join Date
    Jan 2000
    Fairfax, VA
    Last edited by TonyT; 08-17-09 at 11:44 AM.
    No one has any right to force data on you
    and command you to believe it or else.
    If it is not true for you, it isn't true.


Similar Threads

  1. Philip's Backup Batch File
    By wch5908 in forum Programming Forum
    Replies: 3
    Last Post: 04-06-08, 05:24 PM
  2. First Network
    By choltas in forum Networking Forum
    Replies: 10
    Last Post: 03-30-07, 07:14 AM
  3. eXtreme styles mod 2.3.1 (phpbb2)
    By pinguinosupremo in forum Software Forum
    Replies: 0
    Last Post: 02-26-07, 02:13 AM
  4. winantivirus again
    By robertdempster in forum Software Forum
    Replies: 12
    Last Post: 02-20-07, 08:57 AM
  5. Yummy VISTA Home Premium
    By Lobo in forum Broadband Tweaks Help
    Replies: 2
    Last Post: 02-04-07, 02:57 PM


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts