1.

Solve : Batch file to make backup of a folder based on time and day of week?

Answer»

Thank You Dusty, I tried the script at WORK and i do not know exactly was the wording of the error was, so sorry for the confusion but the taskkill wpont work because CHeckInn need to exit by pressing Exit on its menu screen so i found a program called Eventcoder and i recorded the mouse movement to click Exit and I added the path in the script to run where the Taskkill command LINE use to be and it worked perfectly. So i deleted the sleep command lines and the whole script ran perfectly.

But I will make sure it works as intended and I will post the result tomorrow for you.

But Thank You again for your kind help.Hello Dusty, The script worked great it did made and copied all files to correct folder also even at3.58am last night which it recorded to MON_C shift folder.

Thanks DUsty again. I wanted to add couple things if possible,

1) If the Batchfile can be run as a startup batch file and if it can repeate doing backup every say 3 hours by itself.

2) If there can be option showup which says If you are ready to Backup Press Y and Hit ENTER to continue doing Backup or Press X to wait for 5 minutes.

In option 2 if the backup need to be delayed by 5 minutes can it go to end and restart after 5 minutes in case the CheckInn program is being used. In this case the next back still RUNS on time e.g. 3pm, 6pm, 9pm, 12pm etc.

Can there be a command added to enlarge fonts and may be color the lines seperately.


Thanks you.

1. Copy the .bat file to "C:\DOCUMENTS AND SETTINGS\USERNAME\START MENU\PROGRAMS\STARTUP\". Username is the name of the account which starts on your system, it could be Administrator or some other name. You may also want to delete the commands you have added to kill Checkinn.exe if it has not already been started. You don't need me to schedule when the .bat file will run, see the XP Task Scheduler here..

2. Will respond later.

The use of the COLOR command is shown here.. or enter COLOR/? at the command PROMPT. The only way I know of increasing/decreasing the font size in Cmd.exe is to R.Click the top bar, select Properties>Font and change the font size in the font size slider. You'd have to make this setting apply to all output in the Cmd.exe window.



Thank you Dusty,

I will schedule with Xp Task Scheduler ANS report the results.

Thank you again.Unfortunately I have been unable to locate a timing feature in batch scripting so all timing must be done using the Task Scheduler in order to do what you want.

Make the start of the Checkinn.bat file look like this:
Quote

@echo off
cls
setlocal enabledelayedexpansion


for /f "delims=*" %%1 in (runit.dat) do (
set runit=%%1
)
if "%runit%"=="No" exit

echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo.
color 1c
set/p run= CAN BACKUP BE RUN NOW? (Y/N)...

cls

if "%run%"=="y" call :start

if "%run%"=="Y" call :start

exit

:start

:: Checkinn.bat

and the end of the script to this:
Quote
echo No>runit.dat
exit

Create the file C:\runit.dat containing just the word "Yes" without the quotes.

Create the following script and save it as filename.bat:
Quote
@echo off
cls
echo Yes>runit.dat

Task scheduling Suggestions.
===================
Schedule the main script to run at the times you want, 3 6 9 and 12 pm (note that according to the specs I extracted from your post, these times to not include any backup in Shift A which I have noted as being 4 am to 2pm daily, please confirm). Also schedule the script to start 5 mins after the above times.

This will allow the script to run at the appointed hours and at five mins after those times if backup does not proceed.

Schedule filename.bat to run at say 3.20 6.20 9.20 and 12.20 pm



Thanks Dusty, The Backup is running good so far except i have not added the last post suggestions yet, I wanted to try it first. I a wondering is there a way to get out of screensaver when the batch file starts or say play a music file in wma format so that to bring attention of the person working?

I will add script from your last post tomorrow and let you know how it goes.

Thanks Again.Hi i m new to batch file can any one plz tell me the batch file making process from begning.
will appericiate for helping me out.
regds
himHim6182 - Welcome to the CH forums.

Please do NOT hijack another member's thread, start your own.

Batch scripting info can be found here and there a many many on-line tutorials.

Good luck


Discussion

No Comment Found