Ask Experts Questions for FREE Help !
Ask
    YogeshS's Avatar
    YogeshS Posts: 24, Reputation: 1
    New Member
     
    #1

    Apr 28, 2009, 06:21 AM
    Batch file- Copy current date files
    Dear experts,
    How do I create a dos batch file to copy only todays(current date) files from the directory.
    kbjr14's Avatar
    kbjr14 Posts: 5, Reputation: 1
    New Member
     
    #2

    May 10, 2009, 11:33 PM
    You would need to batch files.

    First one:

    Code:
    @echo off
    set /p destination="Destination: "
    for /f %%a in ('dir') do call copyFile.bat %%a %%~ta %destination%
    Second one (this is where I start getting confused):

    Code:
    @echo off
    set today=%date:~5,15%
    if %today% == %2 copy %1 %3
    From what I can tell, that should work, but it doesn't quite work right. Think you can get it from there?
    PatrickMc's Avatar
    PatrickMc Posts: 2, Reputation: 1
    New Member
     
    #3

    Jun 9, 2009, 07:08 PM
    How do I create a dos batch file to copy only todays(current date) files from the directory.
    Here is a script. (I am assuming that when you say today's files, you mean files modified today.) It starts in directory "dir1". It copies files to "dir2" .

    Code:
    var str today ; set today=gettime()
    cd "dir1"
    var str list ; lf -n "*" ( ($fmtime >= $today) AND ($fmtime <= $today) AND ($ftype=="f") ) > $list
    while ($list <> "")
    do
        var str file ; lex "1" $list > $file
        system copy $file "dir2"
    done
    Script is in biterscripting ( http://www.biterscripting.com ) .

    Patrick
    shuaib's Avatar
    shuaib Posts: 1, Reputation: 1
    New Member
     
    #4

    May 2, 2012, 11:39 PM
    How do I create a dos batch file to copy files into current date folder

Not your question? Ask your question View similar questions

 

Question Tools Search this Question
Search this Question:

Advanced Search

Add your answer here.


Check out some similar questions!

How to pass username & password through batch file [ 1 Answers ]

Hello experts I am conneting to my ftp server through batch file. But every time it is asking me for username & password So how do I pass the authentification (username & Password) parameters through the batch file itself. (I need to automate my batch file , passing the username and...

Batch file over LAN [ 2 Answers ]

I want to install bat file over lan

The foolproof backup batch file! [ 4 Answers ]

Hi, hope this is the right place to ask about windows XP dos batch files. I fix home PCs for a living and want to make a foolproof backup procedure that runs overnight. I want the user to plug in a USB drive Thursday eve and take it away on Friday with the backup files on it. Im using Acronis...

Batch files, add/remove programs check possible? [ 1 Answers ]

Hello, :confused: I am wondering if it is possible to have a batch file check the applications that are installed by checking add/remove programs? Or Maybe there is an easier way to accomplish this check with a batch file? Thanks for all of your time.

Batch File In Dos [ 2 Answers ]

How do I make a batch file in dos that will open a program. I need to name the file S The file is acct\prog\solomon\solomon I have this in one PC but forgot how it create the command.


View more questions Search