<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"><channel><title>Tech-Recipes - Latest Comments in Windows Batch File (.bat) to get current date in MMDDYYYY format. | Computer programming | Tech-Recipes</title><link>http://tech-recipes.disqus.com/</link><description>Cookbook of Tech Tutorials</description><language>en</language><lastBuildDate>Tue, 06 Oct 2009 12:27:35 -0000</lastBuildDate><item><title>Re: Windows Batch File (.bat) to get current date in MMDDYYYY format. | Computer programming | Tech-Recipes</title><link>http://www.tech-recipes.com/rx/956/windows-batch-file-bat-to-get-current-date-in-mmddyyyy-format/#comment-19192825</link><description>Thanks, this is exactly what I was looking for!</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">facebook-501042357</dc:creator><pubDate>Tue, 06 Oct 2009 12:27:35 -0000</pubDate></item><item><title>Re: Windows Batch File (.bat) to get current date in MMDDYYYY format. | Computer programming | Tech-Recipes</title><link>http://www.tech-recipes.com/rx/956/windows-batch-file-bat-to-get-current-date-in-mmddyyyy-format/#comment-16184449</link><description>THANKS I GOT MY SOLUTION FROM THIS SITE, THANKS RYAN</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">girija</dc:creator><pubDate>Tue, 08 Sep 2009 09:35:13 -0000</pubDate></item><item><title>Re: Windows Batch File (.bat) to get current date in MMDDYYYY format. | Computer programming | Tech-Recipes</title><link>http://www.tech-recipes.com/rx/956/windows-batch-file-bat-to-get-current-date-in-mmddyyyy-format/#comment-15587909</link><description>one liner (YYYYMMDD): %date:~10,4%%date:~4,2%%date:~7,2%&lt;br&gt;output: 20090830</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">David Thomas</dc:creator><pubDate>Sun, 30 Aug 2009 03:02:06 -0000</pubDate></item><item><title>Re: Windows Batch File (.bat) to get current date in MMDDYYYY format. | Computer programming | Tech-Recipes</title><link>http://www.tech-recipes.com/rx/956/windows-batch-file-bat-to-get-current-date-in-mmddyyyy-format/#comment-15527469</link><description>Thank you seamonkey420,&lt;br&gt;&lt;br&gt;This is just what I was looking for.&lt;br&gt;&lt;br&gt;~Bill</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">foAudits</dc:creator><pubDate>Fri, 28 Aug 2009 10:41:15 -0000</pubDate></item><item><title>Re: Windows Batch File (.bat) to get current date in MMDDYYYY format. | Computer programming | Tech-Recipes</title><link>http://www.tech-recipes.com/rx/956/windows-batch-file-bat-to-get-current-date-in-mmddyyyy-format/#comment-15423092</link><description>how can I create a file.txt containing the name of a file with the date of yesterday?&lt;br&gt;&lt;br&gt;for example:&lt;br&gt;&lt;br&gt;I have to create a file named:&lt;br&gt;script_ftp.txt -&amp;gt; within this file must be:&lt;br&gt;&lt;br&gt;get TCFILE720/TCCFASIE.F(dated yesterday) S: \ files \ TCCFASIE.F(dated yesterday)&lt;br&gt;&lt;br&gt;how can I create a file.txt containing the name of a file with the date of yesterday?&lt;br&gt;&lt;br&gt;for example:&lt;br&gt;&lt;br&gt;I have to create a file named:&lt;br&gt;script_ftp.txt -&amp;gt; within this file must be:&lt;br&gt;&lt;br&gt;get TCFILE720/TCCFASIE.F20090825 S: \ files \ TCCFASIE.F20090825.dat</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">ASh</dc:creator><pubDate>Wed, 26 Aug 2009 11:30:30 -0000</pubDate></item><item><title>Re: Windows Batch File (.bat) to get current date in MMDDYYYY format. | Computer programming | Tech-Recipes</title><link>http://www.tech-recipes.com/rx/956/windows-batch-file-bat-to-get-current-date-in-mmddyyyy-format/#comment-15320477</link><description>The solution using VB script is awesome. &lt;br&gt;Eventually, extracting date is independent of regional setting on each particular computer. &lt;br&gt;&lt;br&gt;Thank you, marcwentink.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">ahopici</dc:creator><pubDate>Mon, 24 Aug 2009 15:16:00 -0000</pubDate></item><item><title>Re: Windows Batch File (.bat) to get current date in MMDDYYYY format. | Computer programming | Tech-Recipes</title><link>http://www.tech-recipes.com/rx/956/windows-batch-file-bat-to-get-current-date-in-mmddyyyy-format/#comment-14790663</link><description>I have read though all of these posts and still can't seem to figure out how to make a directory (folder) with the current date in the following format 09_08_13 (yy_mm_dd). Can anyone help me with this?</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">ashmo</dc:creator><pubDate>Thu, 13 Aug 2009 13:26:51 -0000</pubDate></item><item><title>Re: Windows Batch File (.bat) to get current date in MMDDYYYY format. | Computer programming | Tech-Recipes</title><link>http://www.tech-recipes.com/rx/956/windows-batch-file-bat-to-get-current-date-in-mmddyyyy-format/#comment-14419827</link><description>May this is usefull, especially since it is an example how to get all kinds of everything INDEPENDENT of the current language locale and date format settings using the Windows Scripting Host &lt;br&gt;&lt;br&gt;  ::::::::::::::::::::::::::::::::::::::::::::::::::::::::&lt;br&gt;  ::&lt;br&gt;  :: This uses Windows Scripting Host to set variables&lt;br&gt;  :: to the current date/time/day/day_number&lt;br&gt;  :: for Win9x/ME/NT/W2K/XP etc&lt;br&gt;  :: Thanks go to Todd Vargo for his scripting&lt;br&gt;  ::::::::::::::::::::::::::::::::::::::::::::::::::::::::&lt;br&gt;  @echo off&lt;br&gt;  set TmpFile="%temp%.\tmp.vbs"&lt;br&gt;  echo&amp;gt; %TmpFile% n=Now&lt;br&gt;  echo&amp;gt;&amp;gt;%TmpFile% With WScript&lt;br&gt;  echo&amp;gt;&amp;gt;%TmpFile% .Echo "set year=" + CStr(Year(n))&lt;br&gt;  echo&amp;gt;&amp;gt;%TmpFile% .Echo "set yr="   + Right(Year(n),2)&lt;br&gt;  echo&amp;gt;&amp;gt;%TmpFile% .Echo "set month="+ Right(100+Month(n),2)&lt;br&gt;  echo&amp;gt;&amp;gt;%TmpFile% .Echo "set day="  + Right(100+Day(n),2)&lt;br&gt;  echo&amp;gt;&amp;gt;%TmpFile% .Echo "set hour=" + Right(100+Hour(n),2)&lt;br&gt;  echo&amp;gt;&amp;gt;%TmpFile% .Echo "set min="  + Right(100+Minute(n),2)&lt;br&gt;  echo&amp;gt;&amp;gt;%TmpFile% .Echo "set sec="  + Right(100+Second(n),2)&lt;br&gt;  echo&amp;gt;&amp;gt;%TmpFile% .Echo "set dow="  + WeekDayName(Weekday(n),1)&lt;br&gt;  echo&amp;gt;&amp;gt;%TmpFile% .Echo "set dow2=" + WeekDayName(Weekday(n))&lt;br&gt;  echo&amp;gt;&amp;gt;%TmpFile% .Echo "set iso="  + CStr(1 + Int(n-2) mod 7)&lt;br&gt;  echo&amp;gt;&amp;gt;%TmpFile% .Echo "set iso2=" + CStr(Weekday(n,2))&lt;br&gt;  echo&amp;gt;&amp;gt;%TmpFile% End With&lt;br&gt;  cscript //nologo "%temp%.\tmp.vbs" &amp;gt; "%temp%.\tmp.bat"&lt;br&gt;  call "%temp%.\tmp.bat"&lt;br&gt;  del  "%temp%.\tmp.bat"&lt;br&gt;  del  %TmpFile%&lt;br&gt;  set TmpFile=&lt;br&gt;  set stamp=%year%-%month%-%day%_%hour%.%min%.%sec%&lt;br&gt;&lt;br&gt;  echo The year (YYyy) is "%year%"&lt;br&gt;  echo The year   (yy) is   "%yr%"&lt;br&gt;  echo The month       is   "%month%"&lt;br&gt;  echo The day   (%dow%) is   "%day%"&lt;br&gt;  echo The full weekday name is "%dow2%"&lt;br&gt;  echo.&lt;br&gt;  echo ISO 8601 Day-Of-Week number is "%iso%"&lt;br&gt;  echo.&lt;br&gt;  echo The hour   is "%hour%"&lt;br&gt;  echo The minute is "%min%"&lt;br&gt;  echo The second is "%sec%"&lt;br&gt;  echo.&lt;br&gt;&lt;br&gt;  echo The date and time stamp is "%stamp%"&lt;br&gt;  echo.&lt;br&gt;  echo time   (hhmmss)   (%hour%%min%%sec%)&lt;br&gt;  echo.&lt;br&gt;  echo date A (yyyymmdd) (%year%%month%%day%)&lt;br&gt;  echo date B (mmddyyyy) (%month%%day%%year%)&lt;br&gt;  echo date C (ddmmyyyy) (%day%%month%%year%)&lt;br&gt;  echo.&lt;br&gt;  echo date D [yymmdd]   [%yr%%month%%day%]&lt;br&gt;  echo date E [mmddyy]   [%month%%day%%yr%]&lt;br&gt;  echo date F [ddmmyy]   [%day%%month%%yr%]&lt;br&gt;  :: datetime.bat&lt;br&gt;  ::::::::::::::::::::::::::::::::::::::::::::::::::::::::</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">marcwentink</dc:creator><pubDate>Fri, 07 Aug 2009 04:48:17 -0000</pubDate></item><item><title>Re: Windows Batch File (.bat) to get current date in MMDDYYYY format. | Computer programming | Tech-Recipes</title><link>http://www.tech-recipes.com/rx/956/windows-batch-file-bat-to-get-current-date-in-mmddyyyy-format/#comment-14226647</link><description>Thanks Trent that is what I want: getting day month and year INDEPENDANT of the format used. I am going to study this.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">marcwentink</dc:creator><pubDate>Thu, 06 Aug 2009 05:29:49 -0000</pubDate></item><item><title>Re: Windows Batch File (.bat) to get current date in MMDDYYYY format. | Computer programming | Tech-Recipes</title><link>http://www.tech-recipes.com/rx/956/windows-batch-file-bat-to-get-current-date-in-mmddyyyy-format/#comment-12466877</link><description>Erms, that IS pretty old school, try:&lt;br&gt;&lt;br&gt;Set TDate=%date:~10,4%%date:~4,2%%date:~7,2% &lt;br&gt;&lt;br&gt;&lt;br&gt;1 line = better&lt;br&gt;&lt;br&gt; =D&lt;br&gt;&lt;br&gt;PS.  Also it's bad form to use a variable with the same name as a command, so, don't do that. =P&lt;br&gt;&lt;br&gt;&lt;br&gt;Peace,&lt;br&gt;&lt;br&gt;-B</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Ben Personick</dc:creator><pubDate>Fri, 10 Jul 2009 16:05:11 -0000</pubDate></item><item><title>Re: Windows Batch File (.bat) to get current date in MMDDYYYY format. | Computer programming | Tech-Recipes</title><link>http://www.tech-recipes.com/rx/956/windows-batch-file-bat-to-get-current-date-in-mmddyyyy-format/#comment-10482916</link><description>Thanks guys... I really didn't have time to figure this out myself&lt;br&gt;I was going to recreate xset32 for win64 in c++ or PERL, but this is much easier.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">dan</dc:creator><pubDate>Thu, 04 Jun 2009 10:06:36 -0000</pubDate></item><item><title>Re: Windows Batch File (.bat) to get current date in MMDDYYYY format. | Computer programming | Tech-Recipes</title><link>http://www.tech-recipes.com/rx/956/windows-batch-file-bat-to-get-current-date-in-mmddyyyy-format/#comment-10146094</link><description>Here's what I use.  It queries the registry first to figure out what format the date is going to be returned in.  It currently supports UK and US locales (as that's all I need to support at the moment).  Trivial to extend it to support others.&lt;br&gt;&lt;br&gt;@echo off&lt;br&gt;goto test&lt;br&gt;&lt;br&gt;:get_date_yyyymmdd&lt;br&gt;    setlocal enableextensions enabledelayedexpansion&lt;br&gt;    set _RV=&lt;br&gt;    set _ERR=0&lt;br&gt;    set _CMD=reg query "HKCU\Control Panel\International" /v sShortDate&lt;br&gt;    for /f "usebackq skip=2 tokens=3,* delims= " %%i in (`%_CMD%`) do (&lt;br&gt;        rem Amsterdam/Houston servers:&lt;br&gt;        rem     Short date format (%%i):    M/d/yyyy&lt;br&gt;        rem     Sample %DATE%:              Thu 05/29/2009&lt;br&gt;        rem London servers:&lt;br&gt;        rem     Short date format (%%i):    dd/MM/yyyy&lt;br&gt;        rem     Sample %DATE%:              29/05/2009&lt;br&gt;        set D=!DATE!&lt;br&gt;        echo i: %%i&lt;br&gt;        echo D: !D!&lt;br&gt;        if "%%i"=="M/d/yyyy" (&lt;br&gt;            rem I'm assuming the day abbreviation will always be three chars&lt;br&gt;            rem (so we account for four in total, including the space).  So&lt;br&gt;            rem far, I can attest that this is definitely the case on Wed &amp;&lt;br&gt;            rem Thu ;-)&lt;br&gt;            set yyyy=!D:~-4!&lt;br&gt;            set mm=!D:~-10,-8!&lt;br&gt;            set dd=!D:~-7,-5!&lt;br&gt;        ) else if "%%i"=="dd/MM/yyyy" (&lt;br&gt;            set yyyy=!D:~-4!&lt;br&gt;            set mm=!D:~-7,-5!&lt;br&gt;            set dd=!D:~-10,-8!&lt;br&gt;        ) else (&lt;br&gt;            echo fatal: I don't understand this system's date format (%%i^)&lt;br&gt;            set _ERR=1&lt;br&gt;        )&lt;br&gt;    )&lt;br&gt;    set _RETVAL=!yyyy!!mm!!dd!&lt;br&gt;    endlocal &amp; set _YYYYMMDD=%_RETVAL% &amp; set _ERROR=%_ERR%&lt;br&gt;    exit /b %_ERROR%&lt;br&gt;&lt;br&gt;:test&lt;br&gt;call :get_date_yyyymmdd&lt;br&gt;echo formatted date: %_YYYYMMDD%</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Trent Nelson</dc:creator><pubDate>Thu, 28 May 2009 07:03:21 -0000</pubDate></item><item><title>Re: Windows Batch File (.bat) to get current date in MMDDYYYY format. | Computer programming | Tech-Recipes</title><link>http://www.tech-recipes.com/rx/956/windows-batch-file-bat-to-get-current-date-in-mmddyyyy-format/#comment-9958036</link><description>I had been using a method similar to yours but recently I found one that is even simpler:&lt;br&gt;&lt;br&gt;The %DATE% AND %TIME% variables contain the formated date and time so you an just extract the substrings using regular variable syntax&lt;br&gt;&lt;br&gt;set _DATETIME=%DATE:~10,4%%DATE:~4,2%%DATE:~7,2%%TIME:~0,2%%TIME:~3,2%%TIME:~6,2%&lt;br&gt;&lt;br&gt;In my case&lt;br&gt;&lt;br&gt;%DATE% contains "Tue 05/26/2009"&lt;br&gt;so %DATE:~10,4% means to extract a substring 4 characters long starting from character 10 &lt;br&gt;&lt;br&gt;If you weren't aware of that way of handling substrings for any variables, now you know.&lt;br&gt;&lt;br&gt;If you have a different default date format than mine you will have to adapt the parameters</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Rarsa</dc:creator><pubDate>Tue, 26 May 2009 13:04:11 -0000</pubDate></item><item><title>Re: Windows Batch File (.bat) to get current date in MMDDYYYY format. | Computer programming | Tech-Recipes</title><link>http://www.tech-recipes.com/rx/956/windows-batch-file-bat-to-get-current-date-in-mmddyyyy-format/#comment-9535657</link><description>Or you can use %date% and parse it later in your script.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">FP</dc:creator><pubDate>Tue, 19 May 2009 10:28:00 -0000</pubDate></item><item><title>Re: Windows Batch File (.bat) to get current date in MMDDYYYY format. | Computer programming | Tech-Recipes</title><link>http://www.tech-recipes.com/rx/956/windows-batch-file-bat-to-get-current-date-in-mmddyyyy-format/#comment-8688247</link><description>how can i combine the date and time to create a file name.  please advise&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;echo %date:~10,4%%date:~7,2%%date:~4,2%&lt;br&gt;&lt;br&gt;ren d:\temp\log.pdf Survey%date:~10,4%%date:~7,2%%date:~4,2%.pdf&lt;br&gt;&lt;br&gt;&lt;br&gt;pause&lt;br&gt;&lt;br&gt;for /f "tokens=1-5 delims=:" %%d in ("%time%") do rename "hope.pdf" %%d-%%e.pdf&lt;br&gt;pause</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">James Lubuag</dc:creator><pubDate>Sat, 25 Apr 2009 14:12:14 -0000</pubDate></item><item><title>Re: Windows Batch File (.bat) to get current date in MMDDYYYY format. | Computer programming | Tech-Recipes</title><link>http://www.tech-recipes.com/rx/956/windows-batch-file-bat-to-get-current-date-in-mmddyyyy-format/#comment-8684680</link><description>Okey&lt;br&gt;that helps</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Fuad</dc:creator><pubDate>Sat, 25 Apr 2009 10:22:11 -0000</pubDate></item><item><title>Re: Windows Batch File (.bat) to get current date in MMDDYYYY format. | Computer programming | Tech-Recipes</title><link>http://www.tech-recipes.com/rx/956/windows-batch-file-bat-to-get-current-date-in-mmddyyyy-format/#comment-8505529</link><description>Many thanks.  I started to write my own then quickly remembered writing bat files requires a fine mix of science and art with a dash of experence.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Chris Felpel</dc:creator><pubDate>Tue, 21 Apr 2009 15:36:43 -0000</pubDate></item><item><title>Re: Windows Batch File (.bat) to get current date in MMDDYYYY format. | Computer programming | Tech-Recipes</title><link>http://www.tech-recipes.com/rx/956/windows-batch-file-bat-to-get-current-date-in-mmddyyyy-format/#comment-8294598</link><description>For programmers in the USA, use THIS script instead, otherwise it won't work with the standard Windows US MM/DD/YYYY format.&lt;br&gt;&lt;br&gt;@Echo Off&lt;br&gt;Set YYYY-MM-DD=%DATE:~6,4%-%DATE:~0,2%-%DATE:~3,2%</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Some User</dc:creator><pubDate>Fri, 17 Apr 2009 10:27:07 -0000</pubDate></item><item><title>Re: Windows Batch File (.bat) to get current date in MMDDYYYY format. | Computer programming | Tech-Recipes</title><link>http://www.tech-recipes.com/rx/956/windows-batch-file-bat-to-get-current-date-in-mmddyyyy-format/#comment-7339317</link><description>genius!, simple, elegant! thanks!</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">mike</dc:creator><pubDate>Thu, 19 Mar 2009 08:15:11 -0000</pubDate></item><item><title>Re: Windows Batch File (.bat) to get current date in MMDDYYYY format. | Computer programming | Tech-Recipes</title><link>http://www.tech-recipes.com/rx/956/windows-batch-file-bat-to-get-current-date-in-mmddyyyy-format/#comment-6699960</link><description>not the best at this yet dont even realy know what half what i posted mean but i just got it working with the Filename_"%PDATE%". if you dont want a gap inbetween file and date do Filename"%PDATE%".  hope it helps.&lt;br&gt;&lt;br&gt;FOR /F "TOKENS=1,2 DELIMS=/ " %%A IN ('DATE /T') DO SET mm=%%B&lt;br&gt;FOR /F "TOKENS=2,3 DELIMS=/ " %%A IN ('DATE /T') DO SET dd=%%B&lt;br&gt;FOR /F "TOKENS=3* DELIMS=/ " %%A IN ('DATE /T') DO SET yyyy=%%B&lt;br&gt;&lt;br&gt;set /A dd=%dd%&lt;br&gt;&lt;br&gt;set Pdate=%yyyy%_%mm%_%dd%&lt;br&gt;echo %Pdate%&lt;br&gt;&lt;br&gt;mkdir C:\MYFILE_"%PDATE%"\</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">leif</dc:creator><pubDate>Fri, 27 Feb 2009 09:26:51 -0000</pubDate></item><item><title>Re: Windows Batch File (.bat) to get current date in MMDDYYYY format. | Computer programming | Tech-Recipes</title><link>http://www.tech-recipes.com/rx/956/windows-batch-file-bat-to-get-current-date-in-mmddyyyy-format/#comment-6596175</link><description>how to save file with filename+current date&lt;br&gt;ex : myfile20090210</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">rvsdi</dc:creator><pubDate>Wed, 25 Feb 2009 04:45:37 -0000</pubDate></item><item><title>Re: Windows Batch File (.bat) to get current date in MMDDYYYY format. | Computer programming | Tech-Recipes</title><link>http://www.tech-recipes.com/rx/956/windows-batch-file-bat-to-get-current-date-in-mmddyyyy-format/#comment-6383204</link><description>Perfect, exactly what i wanted, thanks for saving me 2 hours !</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Marcus</dc:creator><pubDate>Wed, 18 Feb 2009 16:27:52 -0000</pubDate></item><item><title>Re: Windows Batch File (.bat) to get current date in MMDDYYYY format. | Computer programming | Tech-Recipes</title><link>http://www.tech-recipes.com/rx/956/windows-batch-file-bat-to-get-current-date-in-mmddyyyy-format/#comment-6058512</link><description>Ryan, I love it, it is great one line no trickery with files etc. I expanded it further my requirements.&lt;br&gt;&lt;br&gt;echo Get the current date and time in YYYY-MM-DD-HH-MM-SS format&lt;br&gt;SET isodt=%date:~10,4%-%date:~7,2%-%date:~4,2%-%time:~0,2%-%time:~3,2%-%time:~6,2%&lt;br&gt;echo %isodt%&lt;br&gt;&lt;br&gt;Thanks a million</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Hersch</dc:creator><pubDate>Fri, 06 Feb 2009 19:37:24 -0000</pubDate></item><item><title>Re: Windows Batch File (.bat) to get current date in MMDDYYYY format. | Computer programming | Tech-Recipes</title><link>http://www.tech-recipes.com/rx/956/windows-batch-file-bat-to-get-current-date-in-mmddyyyy-format/#comment-5887019</link><description>like my file in E drive - 06022009.DMP  so how can copy this file in CD Drive using Batch file. my batch file is :- &lt;br&gt;@echo off&lt;br&gt;cls&lt;br&gt;echo Copying started at %date% %time%&lt;br&gt;xcopy "E:\%date%.DMP" "C:\Documents and Settings\Hp1\Local Settings\Application Data\Microsoft\CD Burning\BACKUP\*.*" /s /e /h /c /d /i /y &lt;br&gt;xcopy "C:\Documents and Settings\Hp1\Local Settings\Application Data\Microsoft\CD Burning\BACKUP\*.*" "G:\BACKUP\*.*"&lt;br&gt;PAUSE&lt;br&gt;explorer g:</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Rakesh Bhangre</dc:creator><pubDate>Fri, 06 Feb 2009 02:31:41 -0000</pubDate></item><item><title>Re: Windows Batch File (.bat) to get current date in MMDDYYYY format. | Computer programming | Tech-Recipes</title><link>http://www.tech-recipes.com/rx/956/windows-batch-file-bat-to-get-current-date-in-mmddyyyy-format/#comment-5565159</link><description>why not just do this:&lt;br&gt;&lt;br&gt;set mydate=%date:~4,2%%date:~7,2%%date:~10,4%</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Ryan</dc:creator><pubDate>Mon, 26 Jan 2009 20:06:33 -0000</pubDate></item></channel></rss>