Computing.Net > Forums > Programming > batch file to find and copy

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Click here to start participating now! Also, check out the New User Guide.

batch file to find and copy

Reply to Message Icon

Name: David04
Date: January 20, 2004 at 21:11:39 Pacific
OS: xp
CPU/Ram: 2.54Ghz 512Mb
Comment:

Hi,

I currently have a batch file thats creates a new directory with the current date as its name (in the format YYYYMMDD). Is it possible to have another batch file that finds this directory and copies files to it?



Sponsored Link
Ads by Google

Response Number 1
Name: dtech10
Date: January 21, 2004 at 14:21:20 Pacific
Reply:

Hi
I take it your using the american date format ie. MM/DD/YYYY. If so will this help.

@echo off
set XDate=:~7,4%%date:~0,2%%date:~3,2%
rem Xdate should equal YYYYMMDD.

rem 2nd batch file o0r same batch file
copy *.* %XDate%
rem or path to XDate directory.

------------------
You could use the above to create the directory
md %XDate%


0

Response Number 2
Name: lenin
Date: February 2, 2004 at 23:41:47 Pacific
Reply:

Hi,

I need to write a bacth file to backup the processed file to a backup directory. Backup file name should include the current date at the end. I am facing problem in formatting the date, since the windows doesn't allow back-slash(/) as part of the file name.

Regards,

Lenin


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


netbeans classpath Word Macro End of Doc?



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: batch file to find and copy

Batch file to start and stop servic www.computing.net/answers/programming/batch-file-to-start-and-stop-servic/15882.html

Batch File to find files www.computing.net/answers/programming/batch-file-to-find-files/17076.html

Batch file to find ip and host name, and save www.computing.net/answers/programming/batch-file-to-find-ip-and-host-name-and-save/19455.html