Sign in with
Sign up | Sign in
Your question

Batch File Help

Last response: in Windows XP
Share
August 3, 2011 8:05:55 PM

Hello forum,

I found this forum very useful, I actually want help about batch file.

I have created one batch file to start service and i have added this file to start up programs so when computer opens it run the service but now the problem is i am using sms software which is using remote mysql so if my internet connection not establish it will not start service and give me error like the service could not be started.. and before my internet establish it run batch file so service start failed....

In short i want to set timing in batch file like after computer start it try to run service after 3 or 4 minutes bcoz till that my internet will be connected and when it try to start service it will start service successfully..

My batch file codes are..

Quote:

net start | find "AxSmsSvc" > nul 2>&1
if not .%errorlevel%.==.0. goto startservice
goto end

:startservice
net start "AxSmsSvc"
echo service restarts @ %date% %time% >> C:\checklog.txt

:end
Pause


I am not expert so if someone can re-edit this code and give me the code that will be good i will copy code to batch file thanks...

More about : batch file

August 4, 2011 8:11:46 PM

Look at the choice command, which supports a timeout before continuing with a default choice.
m
0
l
!