Computing.Net > Forums > Windows XP > Make a batch file to copy data

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Make a batch file to copy data

Reply to Message Icon

Name: cortneyc
Date: May 3, 2004 at 10:08:54 Pacific
OS: XP Pro
CPU/Ram: P4 2.66, 512 mb Ram
Comment:

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!



Sponsored Link
Ads by Google

Response Number 1
Name: didorno
Date: May 3, 2004 at 12:42:33 Pacific
Reply:

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.


0

Response Number 2
Name: trutexan
Date: May 3, 2004 at 19:53:36 Pacific
Reply:

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


0

Response Number 3
Name: trutexan
Date: May 3, 2004 at 19:59:53 Pacific
Reply:

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


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

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


Go to Windows XP Forum Home


Sponsored links

Ads by Google


Results for: Make a batch file to copy data

Using BATCH file to backup data www.computing.net/answers/windows-xp/using-batch-file-to-backup-data/66927.html

Batch file to download files? www.computing.net/answers/windows-xp/batch-file-to-download-files/148745.html

convert a batch file to exe www.computing.net/answers/windows-xp/convert-a-batch-file-to-exe/53610.html