Home / Microsoft / Microsoft DOS / Calling a batch file from another batch file
0 Members and 3 Guests are viewing this topic. « previous next »
Pages: 1 [2]  All - (Bottom) Print
Author Topic: Calling a batch file from another batch file  (Read 24374 times)
ABIAMDTECH
Topic Starter
Rookie



Posts: 17


« Reply #15 on: February 05, 2009, 10:56:57 PM »

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?
IP logged
Biker Steve
Rookie



Posts: 16


« Reply #16 on: February 17, 2009, 04:45:14 AM »


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.

 
IP logged
Biker Steve
Rookie



Posts: 16


« Reply #17 on: February 17, 2009, 09:52:39 AM »

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
IP logged
Pages: 1 [2]  All - (Top) Print 
Home / Microsoft / Microsoft DOS / Calling a batch file from another batch file « previous next »
 


Login with username, password and session length

Old Forum Search | Forum Rules
Copyright © 2010 Computer Hope ® All rights reserved.
Powered by SMF 2.0 RC3 | SMF © 2006–2010, Simple Machines LLC
Page created in 0.091 seconds with 19 queries.