Results 1 to 2 of 2

Thread: batch file to copy file to another place

  1. #1
    Join Date
    May 2011

    batch file to copy file to another place

    I want to copy file to another place using copy command and save it with the name of system date. But the execution shows zero files copied. Please help me find the error.

    @echo off
    :: variables
    set hour=%time:~0,2%
    if "%hour:~0,1%"==" " set hour=0%time:~1,1%
    set name=%date:~10,4%_%date:~4,2%_%date:~7,2%_%hour%_%time:~3,2%
    set source=C:\abc.jpg
    set desitination=C:\%name%.jpg
    set backupcmd=copy /V /-Y

    echo Copying up downloaded file...
    %backupcmd% "%source%" "%destination%"

    echo Copying Complete!

  2. #2
    Join Date
    Oct 2004

    Re: batch file to copy file to another place

    I think that you might want to take a look at XCopy or RoboCopy which are pretty comprehensive solutions for nearly all file copy operations on Windows.

Similar Threads

  1. Batch file to copy ip
    By zaharkl in forum Technology & Internet
    Replies: 1
    Last Post: 21-04-2011, 11:50 AM
  2. Windows Batch file to output directory names and size to txt file
    By m2thearkus in forum Software Development
    Replies: 6
    Last Post: 16-07-2010, 01:04 AM
  3. Batch File to Move or Copy Files
    By Pratim in forum Windows Software
    Replies: 6
    Last Post: 21-03-2010, 10:32 PM
  4. Dos batch file to sort files based on file names.
    By Jon Osborn in forum Windows Server Help
    Replies: 9
    Last Post: 17-06-2009, 12:06 PM
  5. Replies: 3
    Last Post: 12-03-2009, 01:56 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