How to stop a batch file

Hello everyone!
I need your help
I have a batch that runs during a power failure. The purpose of this batch file is to gracefully shut down my Database before my backup battery shuts down the system. The batch is bretty simple
name: onbattery.bat
code---
<pre>
timeout /t 100
clcontrol /system idle
</pre>
The problem I have is that if the power comes back on before the countdown is finished, i want onbattery.bat to completely stop, so that i avoid turning off my database.
I have been doing much research today and I can't seem to find a command that cancels a batch file. Is this possible?
I have a second batch file I created that turns my DB back (offbattery.bat) on but it would be great if I could, at the begining of that batch say "first cancel any instance of 'onbattery.bat', now turn on my DB.
Just to be clear, here is what my offbatter.bat file looks like
<pre>
timeout /t 100
clcontrol /system FOH
</pre>
Any help would be greatly appreciated.

i hear what you all are saying. But the problem is that these APC were recently bought and now we just have to "make them work"  I am not using APC Powerchute software since these battries are technically for small home office work.  But I am using
a 3rd party program APCUPSD that actually works great. The software recognizes where there is a power outage and goes to its onbattery command.  As long as i create a script that is called the same thing as the event the the APC software batch file understands,
it will run it.
I just need to be able to create my offbattery.bat file to say the following:
First kill/cancel onbattery.bat
Next Turn on my database
I want to kill the onbattery.bat script to stop it from turning off my DB.  This is in case the site looses power for less than 9 min.  I wast the DB to stay on without interrupting normal business for my restaurant.
Is there a way to use another batch file to cancel an already running batch file?

Similar Messages

  • How to create a Batch file for java application  ?

    HI,
    How to create a Batch file for java application ?
    And whats the use of creating batch file ?
    Thanks in advance

    [http://static.springsource.org/spring-batch/]
    Assuming you want to develop a batch application rather than actually just create a .bat file ..

  • HOw to create a Batch file for java application and whats the use of this ?

    HI,
    How to create a Batch file for java application ?
    And whats the use of creating batch file ?
    Thanks in advance

    First of all, you're OT.
    Second, you can find this everywhere in the net.
    If you got a manifest declaring main class (an classpath if needed), just create a file named whatever.bat, within same directory of jar file, containing:
    javaw -jar ./WhateverTheNameOfYourJarIs.jar %*By the way, assuming a Windows OS, you can just double click the jar file (no batch is needed).
    Otherwise use:
    javaw -cp listOfJarsAndDirectoriesSeparedBySemiColon country/company/application/package/className %*Where 'country/company/application/package/' just stands for a package path using '/' as separator instead of '.'
    Don't specify the .class extension.
    Javaw only works on Windows (you asked for batch, I assumed .BAT, no .sh), in Linux please use java.exe (path may be needed, Windows doesn't need it 'cause java's executables are copied to system32 folder in order to be always available, see PATH environment variable if you don't know what I'm talking about) and use ':' as classpath (cp) separator.
    The '%***' tail is there in order to pass all parameters, it only works on Windows, refer to your shell docs for other OSs (something like $* may work).
    This way you have a command you can call to launch your code (instead of opening NetBeans just to see your app working). You could schedule tasks on it or just call it in any command prompt (hope you know what it is 'cause there have been people in this very same forum with no clue about it, if not just hold the 'Windows button' and press 'R', then type 'cmd' and run it).
    Finally add dukes and give 'hem away.
    Bye.

  • How to execute a batch file on different remote server using TFS Build

    I have a build server and have 2 web servers. I am deploying using TFS Builds. Now, I have a requirement to execute a batch file which is kept on these 2 web servers. i.e. C:\MyBatch\CreateMe.bat
    After my build is successful, I need to execute this batch from the build server.
    Note, I cannot make any shared folder.

    Hi Sameer, 
    Thanks for your post.
    What’s the version of your TFS?
    How do you deploy solution using TFS Build, run MSBuild deploy command or using Release Management?
    That C:\MyBatch\CreateMe.bat file stay on your two web server machines separately? 
    If you want execute this bat file on your two web server machines separately using build process template, you need configure your web server machine as build agent, then add the InvokeProcess activity in build process template to run the bat file on build
    agent machine after build, please refer to Hari’s answer reply in this post:
    https://social.msdn.microsoft.com/Forums/vstudio/en-US/b8bcb19f-1296-441c-8356-e701b949445a/tfs-2010-how-to-execute-a-batch-file-after-build?forum=tfsbuild.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How to run a batch file as windows Nt service

    Hi friends
    I want to know how to run a batch file as windows NT service.
    I got some information in the following link
    http://support.microsoft.com/kb/q243486/
    I tried it but i want to know what we need to include in Autoexnt.bat
    And one thing i need Instexnt.exe file. I cannot find tht file.
    Please search tht file and send me tht file or else send the link in which this file is present
    Please give me reply fast.its very urgent.
    Thanks in advance.

    Hi,
    My aim is to run a MS-DOS Batch file, that I created to run a Java Prgram.
    I need to call the Batch File from the Oracle Procedure, Also I may need to change the content of the Batch File (Argument to the Java JAR File ).
    I can keep the JAR FIle either in the Oracle Server or in the Application Server.
    The Java program is to convert XML Format FIle to PDF and MS Word format.
    Oracle Version : 10g 2.0.1.0.
    Thanks in advance
    Rizly

  • How to run a batch file

    Hi,
    How to run a batch file from Oracle. Is it possible directly from PLSQl, or should I write the java code.
    Oracle Version: 10g 2.0.1.0.
    Thanks in advance
    Rizly

    Hi,
    My aim is to run a MS-DOS Batch file, that I created to run a Java Prgram.
    I need to call the Batch File from the Oracle Procedure, Also I may need to change the content of the Batch File (Argument to the Java JAR File ).
    I can keep the JAR FIle either in the Oracle Server or in the Application Server.
    The Java program is to convert XML Format FIle to PDF and MS Word format.
    Oracle Version : 10g 2.0.1.0.
    Thanks in advance
    Rizly

  • How to run the batch files

    Hi Experts,
    I am trying to implement automatic cache purging every day at specified time and i created txt file with SApurge All cache() and created bat file with nqcmd -q Analyticsweb -u username -p password -s (txt file location).
    Now i want to run this bat file daily at specified time with out executing manually may i know how to run the batch file at specified time .
    Thanks,

    There is task type as command in workflow manager if you want you can go for that during the load
    nqcmd -d "AnalyticsWeb" -u Administrator -p Administrator -s "D:\PowerCenter8.1.1\server\infa_shared\SrcFiles\1_BIPurgeCache.txt"
    Check these urls
    http://docs.oracle.com/cd/E12103_01/books/AnySched/AnySched_Scripts3.html
    http://deliverbi.blogspot.com/2011/12/purge-all-cache-from-dashboard.html

  • How to stop a batch job

    Hi Folks,
    Please do let me know how to stop a batch job.
    I am having a batch job which will run a program for every 15 mins in order to update some Z-tables.
    I need to debug and do some investigation. Meanwhile when I am doing this debugging it may take 20-30 mins also. Here this background job scheduling is getting started and the table getting updated and I am not able to do any investigation..
    Can anyone please let me know how can I stop this batch job scheduled every 15 mins taht is make it stop for an hour. So that after my investigation it should keep on running the batch job for every 15 mins.
    Regards
    Mac

    If u schedule this job from SM36 then u can make it active or inactive from there only. From SM36 ..give the name of ur job then press Extended job selection button..then in next screen choose Active tab and there u can check the checkbox "Job on longer active in time interval" and then give ur time.
    Hope this info will help u.
    Regards,
    Joy.

  • How to run a batch file clicking a button?

    Hi All,
    Can you tell me anyone how to run a batch file clicking a button? And also the progress bar showing the progress.
    Arif

    As said: write the insert statement like above (of course replace the databaselink, column and table names with your own) in a stored procedure and call this procedure in the WHEN-BUTTON-PRESSED Trigger.
    As for the progress bar: how many records are you processing and how is the network connection between your database server? As above method is rather fast it might take just a few seconds and you could spare you the progress bar (this might be a little tricky to implement).
    cheers

  • How to create a batch file to stop/start only essbase services 11.1.2.2

    Hi,
    I have a requirement to build a batch file to schedule stop or start essbase. This batch files should run daily once. Version 11.1.2.2.
    I have tried to prepare a batch file which is calling the default service restart batch StartEssbase.bat and stopEssbase.bat.
    Stop process is running fine. But, Start is not success. When I run StartEssbase.bat and stopEssbase.bat manually essbase is restarting successfully.
    I tried with the command like START ESSCMD.exe "Password" also. Still it is not working.
    Could any one please help with the batch scrpit how can I build to start or stop essbase.
    Thanks
    Srilatha Dasari

    Hi,
    You can use these...
    Start essbase-------------------------------
    REM ----------EssbaseAgent Start----------
    net start HyS9ESBAgent11.1.1_hypservice_1
    SET CHK46=%ERRORLEVEL%
    IF "%CHK46%" NEQ "0" (
         ECHO "ERROR IN STARTING THE ESSBASE SERVICE"
         EXIT /B 46
    ) ELSE (
         ECHO "STARTING ESSBASE SERVICE WAS SUCCESSFUL"
         EXIT /B 0
    PAUSE
    Stop essbase----------------------------------------
    REM ----------Stopping of ESSBASE Service----------
    SET ESB_BIN_DIR=E:\Hyperion\products\Essbase\EssbaseServer\bin
    SET SRCDIR=F:\Essbase\bin
    SET MSHSRC=%SRCDIR%\ShutdownServer.msh
    SET SERVERNAME=XXXXXXXX
    SET USERNAME=XXXXXX
    SET PASSWORD=XXXXX
    REM *****************CALLING ESSBASE ENVIRONMENT SCRIPT***********************
    CALL %ESB_BIN_DIR%\setEssbaseEnv.cmd
    CALL %ESB_BIN_DIR%\ESSMSH %MSHSRC% %USERNAME% %PASSWORD% %SERVERNAME%
    SET CHK10=%ERRORLEVEL%
    IF "%CHK10%" NEQ "0" (
         ECHO ------------------------------------------------------
         ECHO [%DATE% %TIME%] ERROR IN STOPPING THE ESSBASE SERVICE
         ECHO ------------------------------------------------------
         EXIT /B 10
    ) ELSE (
         ECHO ------------------------------------------------------
         ECHO [%DATE% %TIME%] STOPPING ESSBASE SERVICE WAS SUCCESSFUL
         ECHO ------------------------------------------------------
         EXIT /B 0
    The maxl is like
    login $1 $2 on $3;
    alter system shutdown;
    exit;
    Regards
    Snehasis

  • How to create a batch file for a java program?

    I have a java project in JCreator and the project is organised into packages. I have also configured JCreator to provide 2 arguments to the main method when the project is executed.
    I would want to create a batch file (.bat) for this project where the batch file can automatically use the arguments set in JCreator when the program runs.
    How do I go about creating the batch file?

    where the batch file can automatically use the arguments set in JCreatorThat all depends JCreator... can you get those arguments somehow?

  • How to stop WF-BATCH Technical Alert

    Hi everybody,
    I going to explain my case.
    - Everyday I receive a lot of email about WF-BATCH Tecnical Alert into my Inbox. The problem is that the message doesn't have any information, therefore I can't identify what interface throws these alerts. The content of message is like:
    Alert ID: ##43571##
    +----
    +
    Información Técnica
    Código Error:
    Categoría:
    Message ID:
    System ID: PX0
    Mandante: 001
    Sender Interface:
    Sender Namespace:
    Sender Component:
    Receiver Interface:
    Receiver Namespace:
    Receiver Component:
    Adapter Engine Errors
    Adapter Type:
    Error text from the Adapter Engine:
    - Analyzing the case, I detected that we have one interface related to FSCM (CreditCommitmentNotification). When an error ocurrs, the alert is throwing, but this happens on ECC and not in PI.
    Someone knows how to stop those alerts? or What configuration of FSCM is made?
    Thanks
    Vicman

    If u schedule this job from SM36 then u can make it active or inactive from there only. From SM36 ..give the name of ur job then press Extended job selection button..then in next screen choose Active tab and there u can check the checkbox "Job on longer active in time interval" and then give ur time.
    Hope this info will help u.
    Regards,
    Joy.

  • How to run a batch file using tigger....

    Hi, i am trying run a batch file using a trigger on a table.
    say i have a table XYZ(col_1 varchar2 primary key, col_2 varchar2)
    the values of col_2 keeps changing and col_1 are constant
    whenever the value of col_2 in any row changes from "on" to "off" i want to run a batch file C:\Users\ABC\Desktop\test.bat
    i did some searching but couldn't find any solution. Thanks in advance
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    sorry wrong foum to post.
    will post in the correct one
    how to run batch file using trigger?

    Hallo,
    welcome to the forum.
    This is the forum for the tool {forum:id=260}. Your question should be placed in {forum:id=75} or {forum:id=61}.
    When you post your question there please provide additional information like db version, what kind of trigger you want to use, how you want to prevent the execution when the transaction is rolled back... {message:id=9360002}
    Regards
    Marcus

  • How to stop 12 flv files all loading at once

    Hi Guys,
    Ive just created a page with 12 FLV players, all to play
    audio, problem is, when you click open the page, all the tracks
    seem to be loading into the players.
    Can some one please tell me how to stop this, Im a flash
    newbie so please leave me tips on how to do this.
    Also is there any code i can put in the html page, or will i
    need to recode each FLV seperately.
    Many thanks for your help.
    Tobes

    There are a couple of ways I think would work.
    1. Use only one Playback Component. At the appropriate time,
    change the content of that single player using
    instanceName.contentPath = "new file name";
    2. If you use multiple players, set the parameters to not
    automatically load. At the appropriate tim use
    "instanceName.load();"

  • How to stop parse XML file

    When using saxParser.parse(XMLfile, handler) to parse XML file, How to stop the parsing but not exit. I catched thread interrupted in startElement(), but can not stop it because it still go through all other startElement()s and endElement()s. Is there any method or class can stop parse XML?
    Appreciate your help!
    Edward

    Please look at the technote:
    http://access1.sun.com/technotes/01185.html
    Hope this helps.
    Michelle Cope
    Sun Microsystems.

Maybe you are looking for

  • One track is always truncated when I try to import

    This is the weirdest thing. I am running iTunes 7.7 on my MacBook, although this problem appears to have occurred ages ago when I originally ripped this CD. It's a store-bought classical CD, which I very much like. When I put it in the drive, it show

  • My system is asking to run the hard disk test run...What i have to do? can any one guide me????

    model is Hp Pavilion  g6.. windows 7 home basic, My system is asking to run the hard disk test run.. i have run , there was no error, but the message is still comming, i do not kow whether i amdoing it in a right way or not.. Please any giude do that

  • Setting Document Headers in Appleworks 6

    How do I fix a letter so the first page has my letterhead and all following pages have a header with a page number? I found how to insert a header and put a page number and date in it, but can't figure how to make that NOT appear on the first page. T

  • Changing name in Org structure - central person

    Hello All, I have got request for name change in SRM. So, i have changed the name details in SU01 and it is not reflecting at central person. I even tried to edit but it was of no use. Could you please help me on changing the name at central person i

  • Delete transaction type

    I have created a new transaction type in AO78, but i specified a wrong transaction type group:55 (post depreciation), later on this new transaction type can't be seen in AO78, we only can see it from overview for experts/check transaction type, but w