I am trying to write a batch file which will do following.
When it is opened (manually, i do not want to have it run automatically) or double clicked on it from desktop shortcut:
1. It will exit a program called CheckInn first, which is on drive C and directory CheckInn\checkInn.exe
2. It will flash the words like " Please wait for Backup to complete" and do all the copying in background.
3. It will make the directory on Drive E (external USB 160gb Hard drive) named "CheckInn_Sun_A" based on Sunday (Sun) and A for first shift (between 4.01am to 2pm, B for second shift, from 2.01pm to 10pm and C for third shift, from 10.01pm to 4am Monday morning), If the day is Monday (after 4.01am) it will say CheckInn_Mon_A or CheckInn_Mon_B for second shift etc.
4. The CheckInn directory had sub directory also and only some files which are changed or created new since last copy need to be added to the earlier copy so it is not taking too much time to finish.
5. It will say " Backup Done! CheckInn is starting now"
6. It will restart the Checkinn.exe from Drice C:\CheckInn\
7. Close the Command window.
Here is what I did so far, (I do not know how to insert SUN or A as per the day and time so i asked to inupt manually) too much about XP commands but know limited DOS commands which i learned 15 years ago.
::
@echo off
C:\kill /f checkInn.exe
echo What day is today? Type the corresponding number and hit Enter.
echo Sun=1, Mon=2, Tue=3, Wed=4, Thu=5, Fri=6 or Sat=7
set /p D=
go to %D%
:1
echo what shift you are working?
echo Type A for First Shift, B for Second and C for Third Shift and hit Enter.
set /p S=
goto %S%
:a
:A
echo Please wait for Backup to complete. Thank you.
@echo off
E:\
mkdir CheckInn_Sun_A
xcopy c:\CheckInn\*.* E:\CheckInn_SUN_A /S /E /M /H /Q
cls
echo Backup Done! CheckInn is starting now.
start c:\CheckInn\CheckInn.exe
.........Same way it will be for B and C shift and same sequence for rest of days.
Can somebody help with writing the batch file for XP to name directory based on time and Day of week so no manual input is needed and it overwrite the changed files and add new as needed.
Appreciate all your help.