Solved

Attach todays date to a destination file's name in the COPY command

Posted on 2013-10-24
2
330 Views
Last Modified: 2013-10-24
copy P:\RCA-Self Pay\SP_Data\RCAHdr.csv + P:\RCA-Self Pay\SP_Data\RCA.csv P:\RCA-Self Pay\SP_Data\RCAData.txt

What can I add to the destination file name to put today's date in the format "YYYYMMDD" programatically?

Thanks

Glen
0
Comment
Question by:GPSPOW
2 Comments
 
LVL 4

Accepted Solution

by:
lindento earned 500 total points
ID: 39599185
Hi,

echo %date:~10,4%%date:~7,2%%date:~4,2%

will output the date as you requested but you might need to adjust the string location according to your local settings, on my system
Z:\>date /T
Fri 25/10/2013

so i grep out of this string starting from the 10 position next 4 characters which are 2013
and output it and so on.

So your copy command would look like this:

copy P:\RCA-Self Pay\SP_Data\RCAHdr.csv + P:\RCA-Self Pay\SP_Data\RCA.csv P:\RCA-Self Pay\SP_Data\RCAData%date:~10,4%%date:~7,2%%date:~4,2%.txt
which would add the date to the destination file.

Best Regards
0
 

Author Closing Comment

by:GPSPOW
ID: 39599194
Thanks

That did it.

Glen
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

With most software applications trying to cater to multiple user needs nowadays, the focus is to make them as configurable as possible. For e.g., when creating Silverlight applications which will connect to WCF services, the service end point usuall…
For a while now I'v been searching for a circular progress control, much like the one you get when first starting your Silverlight application. I found a couple that were written in WPF and there were a few written in Silverlight, but all appeared o…
This video Micro Tutorial explains how to clone a hard drive using a commercial software product for Windows systems called Casper from Future Systems Solutions (FSS). Cloning makes an exact, complete copy of one hard disk drive (HDD) onto another d…
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question