Writing DOS Batch File

Eidos Batman: arkham asylum (ps3)
March 1, 2010 at 07:28:38
Specs: Windows XP
Hi: I have a batch file that goes out and does an xcopy/compare so that only the changed files/folders are copied from a network share to my external HDD backup (E:\). These are not encrypted nor does the boss want them to be so we are not using the backup software that came with the drive. Now I have a need for restores of daily data so I created 5 folders on the E:\ (MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY) all data in them is the same from an certain date I ran the bat file. Now I want to design a single batch file the will ask file/folder to xcopy to name (MONDAY, TUESDAY, etc) and then do the xcopy/compare to that. Is this possible. Or better yet, for it to look at the day of the week on the PC and automatically run for that weekday, I know this will involve some writing to convert dates to simple MONDAY or TUESDAY etc. Thanks so much.

See More: Writing DOS Batch File

Report •


#1
March 1, 2010 at 10:29:31
@echo off > d.d

>> d.d echo E 0100 B4 2A CD 21 B4 4C CD 21
>> d.d echo N DAY.COM
>> d.d echo RCX
>> d.d echo 8
>> d.d echo W
>> d.d echo Q

debug < d.d > nul
del d.d

day
if errorlevel 0 set day=Sunday
if errorlevel 1 set day=Monday
if errorlevel 2 set day=Tuesday
if errorlevel 3 set day=Wednesday
if errorlevel 4 set day=Thursday
if errorlevel 5 set day=Friday
if errorlevel 6 set day=Saturday
echo Day %day%

del day.com


=====================================
Helping others achieve escape felicity

M2


Report •

#2
March 1, 2010 at 11:35:11
Super, this works, now would you happen to know how I could incorporate it into the directory name and have it store to the appropriately named folder/directory as I wrote it before without the WEEKDAY variable? With the example below, I would like the dumped "MONDAY" to run the process showing (1) of the days of the week xcopies below.

"%LOCALFOLDER%\*.*" E:\ARCHIVE\NICOLE\MONDAY\ /C /S /D /I /Y


Report •

#3
March 1, 2010 at 11:36:11
This was amazing by the way!

Report •

Related Solutions

#4
March 1, 2010 at 12:35:17
You can call the script as a subroutine in your backup bat.

Then:

xcopy "%LOCALFOLDER%\*.*" E:\ARCHIVE\NICOLE\%DAY%\ /C /S /D /I /Y


=====================================
Helping others achieve escape felicity

M2


Report •

#5
March 1, 2010 at 12:40:58
Yes, that is exactly what I did and it seems to work. Thanks so much for all your help, you were amazingly helpful! Have a super afternoon.

Report •

Ask Question