chrisoborski Posted May 6, 2011 Share Posted May 6, 2011 (edited) 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 28800CD %PROGRAMFILES%\VistaPro 6 Server\configCOPY /Y Motion.cfg %PROGRAMFILES%\VistaPro 6 Server\config\dayDEL /Q /F Motion.cfgCOPY /Y %PROGRAMFILES%\VistaPro 6 Server\config\night\Motion.cfg %PROGRAMFILES%\VistaPro 6 Server\config\*.*GOTO MODE:MODESLEEP 32445COPY /Y Motion.cfg %PROGRAMFILES%\VistaPro 6 Server\config\night\DEL /Q /F Motion.cfgCOPY /Y %PROGRAMFILES%\VistaPro 6 Server\config\day\Motion.cfg %PROGRAMFILES%\VistaPro 6 Server\config\*.*SLEEP 50420GOTO MODEEXITHeres the Dir Structure"C:\Program Files\VistaPro 6 Server\config" is the Main DIR /// Subfolders ////"C:\Program Files\VistaPro 6 Server\ Config" | | ------------ | | day nightHopefully 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 May 6, 2011 by chrisoborski Link to comment Share on other sites More sharing options...
chrisoborski Posted May 6, 2011 Author Share Posted May 6, 2011 (edited) 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\configCOPY /Y Motion.cfg C:\nightDEL /Q /F Motion.cfgCOPY /Y C:\day\motion.cfg motion.cfgSLEEP 2TASKKILL.EXE /F /IM DVR.EXETASKKILL.EXE /F /IM ScheduleBackup.exeTASKKILL.EXE /F /IM RSEngine.exeSLEEP 5CD..DVRLOADER.EXE:: ABOVE IS RUN AT 5:40AM:: THEN RUNS BELOW:: BELOW SLEEPS TILL 8:40PM:MODESLEEP 46840:: IS NOW 8:40PM...:: CD %PROGRAMFILES%\VistaPro 6 Server\configCOPY /Y Motion.cfg C:\dayDEL /Q /F Motion.cfgCOPY /Y C:\night\motion.cfg motion.cfgSLEEP 2TASKKILL.EXE /F /IM DVR.EXETASKKILL.EXE /F /IM ScheduleBackup.exeTASKKILL.EXE /F /IM RSEngine.exeSLEEP 5CD..DVRLOADER.EXESLEEP 32400:: IT IS NOW 5:40AM:: CD %PROGRAMFILES%\VistaPro 6 Server\configCOPY /Y Motion.cfg C:\nightDEL /Q /F Motion.cfgCOPY /Y C:\day\motion.cfg motion.cfgSLEEP 2TASKKILL.EXE /F /IM DVR.EXETASKKILL.EXE /F /IM ScheduleBackup.exeTASKKILL.EXE /F /IM RSEngine.exeSLEEP 5CD..DVRLOADER.EXEGOTO 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 May 6, 2011 by chrisoborski Link to comment Share on other sites More sharing options...
Tripredacus Posted May 6, 2011 Share Posted May 6, 2011 Are you required to use DOS programs, these are 16bit programs? What is your OS, is it DOS or Win9x? If it was XP I'd wonder why you didn't try using the Task Scheduler. Link to comment Share on other sites More sharing options...
jaclaz Posted May 7, 2011 Share Posted May 7, 2011 Are you required to use DOS programs, these are 16bit programs? What is your OS, is it DOS or Win9x? If it was XP I'd wonder why you didn't try using the Task Scheduler. or... scripting, use AT or SCHTASK:http://ss64.com/nt/at.htmlhttp://ss64.com/nt/schtasks.htmljaclaz Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now