1.

Solve : Calling a batch file from another batch file?

Answer»

devcom, I have tried the new codes but not thing happen when it reach the set TIME. I am not sure what is preventing the batch files from running. My PLAN B is to stop the driver, because the original problem was the application will not run after I start it the second time. It show me the error message "driver already in use". So maybe if there is a way for me to stop the driver then hopefully I can start the application again without having to restart the laptop. Is there a way to do this?
If not already, as the last executable statement of each of your 3 called batch files Copy.bat, RenameFileToDate.bat and reboot.bat enter the command "exit".

Myself I would also ALLOW more time between the execution of each of the individual 3 batch files.
Maybe as a test you would care to say use 3 minutes or more before executing each batch file.

I have given your problem a little more thought.
Should you execute the following commands you will discover that the time is diplayed as Hours:Minutes:Seconds .

set cTime=%time:~0,-3%
echo '%cTime%'
pause

Your if statements are only testing for the Hours:Minutes.
Therefore your “If” statements contained WITHIN your MS-DOS batch file may not work.
I have also looked at your boolgeon statements and amended them as follows;

echo on
break on
set cTime=%time:~0,-3%
echo '%cTime%'
if '%cTime%' gtr '10:08:00' goto End
if '%cTime%' leq '10:06:00' call Copy.bat
if '%cTime%' leq '10:07:00' call \Hard FAULT Captures\RenameFileToDate.bat
if '%cTime%' leq '10:08:00' call C:\WINDOWS\reboot.bat
:End
@echo.
pause
exit



Discussion

No Comment Found