Jump to content

Almost got it but, I need help making batch file to backup & resto


Recommended Posts

Hi guys, I usually post in the Unattended Windows XP forum but i have a question and i need some direction on this. I have Security Cameras and Software installed at my home and it is Motion Sensing Capable via software. The Motion Detection Settings are set via 1 config file which is in the config DIR. At night the motion Detection is constantly triggered and needs to be adjusted constantly. The day Motion Detection is the similiar. Oh i'm using a DOS exe called sleep.exe to Sleep till X seconds specified...

The Config DIR is the main DIR and under this DIR i have created two subdirectories called "night" and "day". "C:\Program Files\VistaPro 6 Server\config" is the Main DIR and day and night i have created as subfolders. I am trying to have batch file launch at startup and sleep until around 5:40AM, copy said Mtion.cfg config file to a subfolder called Night and delete current config file in the config DIR.

I would like to then Copy a "day" config file from the day Subfolder which is a subfolder located in the config DIR, then reboot to make the new copied config active in the software. I should note that the currently active config file can be deleted while the CCTV Software is running.

At 8:40PM i would like to do the opposite and copy the current config file to Day then delete the config file under the main config DIR. Then copy from the night subfolder located under the config directory to the config directory, then reboot also. Upon rebooting the batch file becomes active again and sleeps til 5:40AM and Loops...

Please let me know where i may be going wrong or if this will not work. :)

Here is my current Non-Working Batch File. I have batch file to run st startup, then sleep till night and so on.



CD\


SLEEP 28800

CD %PROGRAMFILES%\VistaPro 6 Server\config

COPY /Y Motion.cfg %PROGRAMFILES%\VistaPro 6 Server\config\day

DEL /Q /F Motion.cfg

COPY /Y %PROGRAMFILES%\VistaPro 6 Server\config\night\Motion.cfg %PROGRAMFILES%\VistaPro 6 Server\config\*.*





GOTO MODE

:MODE

SLEEP 32445

COPY /Y Motion.cfg %PROGRAMFILES%\VistaPro 6 Server\config\night\

DEL /Q /F Motion.cfg

COPY /Y %PROGRAMFILES%\VistaPro 6 Server\config\day\Motion.cfg %PROGRAMFILES%\VistaPro 6 Server\config\*.*

SLEEP 50420

GOTO MODE

EXIT

Heres the Dir Structure

"C:\Program Files\VistaPro 6 Server\config" is the Main DIR

/// Subfolders ////

"C:\Program Files\VistaPro 6 Server\ Config"

|

|

------------

| |

day night

Hopefully i haven't missed any obvious details. I tried to be clear as possible. I'm pretty sure this is do-able but this is the first batch file iv'e attempted that does these specific things. I have no formal training with dos or the Cmd Prompt.

Thanks Again

-Chris

:::EDITED::: I forgot to mention, the first phase of the batch i was intended to be run at 1:pm and that would start the the initial phase of the running the loop. I intended to edit that part out upon reboot so it would just loop.. Thanks :)

Edited by chrisoborski
Link to comment
Share on other sites


AND DONE!!!

I got it! I walked myself through every command and came up with a working script! ALL i do is launch the batch file at 5:40AM and it will loop indefinitely. Now My software can keep its Night Settings For Night only and For Day only during the day. SWEET!

Here is the CODE!!!



CD\



CD %PROGRAMFILES%\VistaPro 6 Server\config

COPY /Y Motion.cfg C:\night

DEL /Q /F Motion.cfg

COPY /Y C:\day\motion.cfg motion.cfg

SLEEP 2

TASKKILL.EXE /F /IM DVR.EXE

TASKKILL.EXE /F /IM ScheduleBackup.exe

TASKKILL.EXE /F /IM RSEngine.exe

SLEEP 5

CD..

DVRLOADER.EXE



:: ABOVE IS RUN AT 5:40AM
:: THEN RUNS BELOW
:: BELOW SLEEPS TILL 8:40PM




:MODE


SLEEP 46840

:: IS NOW 8:40PM...
::


CD %PROGRAMFILES%\VistaPro 6 Server\config

COPY /Y Motion.cfg C:\day

DEL /Q /F Motion.cfg

COPY /Y C:\night\motion.cfg motion.cfg

SLEEP 2

TASKKILL.EXE /F /IM DVR.EXE

TASKKILL.EXE /F /IM ScheduleBackup.exe

TASKKILL.EXE /F /IM RSEngine.exe

SLEEP 5

CD..

DVRLOADER.EXE




SLEEP 32400

:: IT IS NOW 5:40AM
::


CD %PROGRAMFILES%\VistaPro 6 Server\config

COPY /Y Motion.cfg C:\night

DEL /Q /F Motion.cfg

COPY /Y C:\day\motion.cfg motion.cfg

SLEEP 2

TASKKILL.EXE /F /IM DVR.EXE

TASKKILL.EXE /F /IM ScheduleBackup.exe

TASKKILL.EXE /F /IM RSEngine.exe

SLEEP 5

CD..

DVRLOADER.EXE




GOTO MODE

Can anyone offer any info on where ican learn more advanced DOS / Batch script infromation so i can make more advanced scripts???

Thanks

-Chris :) :) :)

::::EDIT::::

WHOOPS! Looks like i initially posted in the wrong forum...sorry about that didn't realize there was a coding forum... Sorry!

Edited by chrisoborski
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...