Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
How do I make a batch file that will create a directory named the current date and copy specific data from a network drive to that directory?
I'm the best at what I do...and it ain't pretty Bub!

You can use f.i. vbscript. Then the variable NOW gives the current date and time.
With some string manipulation you can generate the new folder. Copying data is then not difficult with this script language.

Here's one I found on the net and use to create a folder on my e: drive with current date - minus the day and / seperators. Then I use xcopy to copy data to that folder. Hope it works for you.
set string=%date%
echo %string%
SET STRING=%STRING:~4%
SET STRING=%STRING:/=%
echo %string%
md e:\%string%
<nobr><a class="iAs" style="border-bottom:darkgreen 1px solid;text-decoration:underline;color:darkgreen;background-color:transparent;" href="#" onclick="return kwC();" target="_blank" oncontextmenu="return false;" onmouseover="kwE(event,64359);" onmouseout="kwL(event);" onmousemove="kwM(64359);">cd</nobr> e:\%string%
xcopy c:\temp\*.* /e e:The <nobr><a class="iAs" style="border-bottom:darkgreen 1px solid;text-decoration:underline;color:darkgreen;background-color:transparent;" href="#" onclick="return kwC();" target="_blank" oncontextmenu="return false;" onmouseover="kwE(event,64484);" onmouseout="kwL(event);" onmousemove="kwM(64484);">web</nobr> site that gave me this info was here
http://www.robvanderwoude.com/index.html

Cortneyc-I don't know where the garbage came from in my response to your batch question so I will try one more time
Here's one I found on the net and use to create a folder on my e: drive with current date - minus the day and / seperators. Then I use xcopy to copy data to that folder. Hope it works for you.
set string=%date%
echo %string%
SET STRING=%STRING:~4%
SET STRING=%STRING:/=%
echo %string%
md e:\%string%
cd e:\%string%
xcopy c:\temp\*.* /e e:
The web site that gave me this info was here
http://www.robvanderwoude.com/index.html

![]() |
![]() |
![]() |

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