Simple two program start and kill the Batch file

Hello all :)

(Today) I am new to the script of the machine. It is something that I put in place and will try tomorrow.

CD /d "C:\path".
Debut.bat

CD /d "H:\path".
Beginning Program.exe

: CHECK
ping localhost 10 1 n > ZERO
AV TASKLIST /fi "IMAGENAME eq program.exe" 2 > & 1 > NULL
IF ERRORLEVEL 1 GOTO CHECK

Taskkill /f /im cmd.exe/t

If all goes well, .bat runs. A program will be executed. CMD will then search for program.exe until not found (released), then close the CMD.

In this case program.exe does not work with start/wait

I wonder if the check will slow down my machine if worked for a few hours.

I use Windows 7 x 64, SSD, 16 GB RAM and AMD 8350.

Considering the insertion of a small time-out, but seems ridiculous.

Is there a way to slow down the check, but always close immediately if program.exe is closed? Other alternatives? Thanks :)

The original manuscript of lots above is more suited for a loop that could sleep until needed, thus reducing CPU cycles

-> You can easily find it by yourself:
1. launch the batch file

2. start the Task Manager.

3. click on the performance tab.

4. Add the "CPU Time" column.

5. sort the list next to the name of the task.

6. take note of the time CPU for cmd.exe.

7. check once again the batch file run for an hour.

I bet that time CPU will be negligible. I expect the timeout function to be very frugal. Tasklist.exe takes more time, but it runs only once every 20 seconds.

Tags: Windows

Similar Questions

  • How to kill the Batch files

    Hello

    I have three files batch for the aggregation.

    I used maxL in the batch file, and there are nearly 10 scripts of aggregation.

    Sometimes I have to kill the batch files... Can anyone please suggest how to kill the ball file while running.


    Thanks in advance.

    Depends on who do OS you run the script, you run the script and why you want to kill the script
    The script can be killed, but this does not mean that the current operation of essbase, you may need to use maxl /eas to try to kill the active session/query.

    See you soon

    John
    http://John-Goodwin.blogspot.com/

  • Automatic execution of the batch file at the connection of the USB drive

    I created a batch file that checks the drive e. the presence of a specific file, and if there, copy it to a location on the hard drive. (Drive E is where all USB drives see the place through my window of Windows Explorer.) I would like to set up my computer so that this batch file is executed whenever such a device is plugged into the USB port. How can I accomplish that?

    Otherwise, is it possible to incorporate the Attaché-USB-player status in the batch file itself and just leave that batch file running at any time? I used "IF EXISTS E:\*.*", but that is not do me much good, because I have to keep control of this condition again and again, and eventually the batch file gets tired of the audit and said that the drive does not exist.

    Hello

    You can ask your question on the TechNet forums for batch files.

    http://social.technet.Microsoft.com/forums/en-us/category/windowsvistaitpro

  • I tried to download trial version of photoshop on creative cloud. 42% the download stops and the program starts to extract the files, BUT when it's done, he says failed to install. When I click on more information ot says: fatal error: "Microsoft C++ R pa

    I tried to download trial version of photoshop on creative cloud. 42% the download stops and the program starts to extract the files, BUT when it's done, he says failed to install. When I click on more information ot says: fatal error: payload "Microsoft C++ Redistributation Pack 2010 (Code output: 34)." Can someone help me please?

    See link below:

    (Exit code: 34 please see specific errors below for troubleshooting.) For example, ERROR: - Summary - 1 or fatal errors, 0 FATAL error: "Microsoft Visual C++ 20 payload.

  • How to reset the default program to open the batch files?

    Original title: I have a batch file and I've changed the default opener of the batch file, HOW to reset it so my batch file work properly again?

    I have a batch file that I use allows me to select a list of websites that I frequent. I accidentally changed the default opener of the batch file, HOW to reset it so my batch file work properly once again, now when I run it it opens for editing.

    Hello

    Control Panel - default programs - associate a Type of file or Protocol with a program.

    Here's what it should be:

    description = current Application of the Windows Batch file .bat = unknown application

    You can use the methods here for re - associate the file type:

    Restore the Type Associations by default Windows 7 file Extension
    http://www.SevenForums.com/tutorials/19449-default-file-type-associations-restore.html

    If necessary, this can be used to not associated with the file type.

    How Unassociate a Type of Extension file in Vista and a utility to help (Windows 7 too)
    http://www.Vistax64.com/tutorials/91920-unassociate-file-extention-type.html

    I hope this helps.

    Rob Brown - MS MVP - Windows Desktop Experience: Bike - Mark Twain said it right.

  • I, stupid, changed the program by default to a BAT file to the cmd prompt, well, now I can't run the batch files now, please help!

    I, stupid, changed the program by default to a BAT file to the cmd prompt, well, now I can't run the batch files now, please help!

    Hi William,.

    Welcome to the Microsoft community.

    Batch file is a type of script file, a text file, containing a series of commands to be executed by the command prompt. When you run a batch file, it opens the command prompt to run the scripts.

    It would be great if you can answer the following questions:

    1. what happens when you try to run a batch file?

    2 are. what batch file you referring?

    3. the problem occurs for a particular batch file?

    First of all, I suggest you to check the commands written in a batch file. To do the same thing, just right-click on the batch file, and then click change. It will open Notepad with the list of orders scripted for this particular batch file.

    If you have additional questions on the computer, please ask your question about Windows and we will be happy to help you.

  • I want cRIO to start and stop the acquisition by push physical button on the cRIO, is this possible?

    When you use my cRIO 9024 on the ground, I prefer to be able to start and stop the acquisition with pressing a physical button on cRIO.

    I want to say I don't want it to be "as a start-up," I don't want cRIO to start the acquisition as soon as the power supply is ensured.

    Is this possible?

    Hi Cashany,

    you will surely find this switch status. But there are easier ways (but more expensive) for a button. Fiddling with a pen or a small screwdriver to switch USER1 is not what I call "user friendly"...

    -You have at least 2 voltage inputs on your module available. Use a switch voltage on the power inputs. Use a 'real' button!

    -You have an available serial port. You can set some pins on GND or voltage and check their status inside the cRIO/RT target...

  • Start and all the missing icons in the Office how can I recover them?

    After downloading Microsoft 6 to 8, the bar start and all the icons disappeared from my office.

    How do their back on again once?

    Hello

    Method 1:

    Follow these steps and check if that helps:

    (a) start on your desktop.

    (b) press CTRL + ALT + DELETE to open the Task Manager.

    (c) in the Task Manager, click on the button new task on the general tab.

    (d) in the new task dialog box, type: ' Explorer to. exe' (without the quotes) and press OK.

    (e) the Office Windows should now appear.

    Method 2:

    Follow the steps in the article, and check if that helps.

    Your desktop icons are missing in Windows XP

    http://support.Microsoft.com/kb/330170

    Method 3:

    Also try creating a new administrator account and check if it helps.

    How to create and configure user accounts in Windows XP

    http://support.Microsoft.com/kb/279783

  • When install us Windows XP (SP3), our program in the will of the computer and lost the installation files?

    Windows XP SP3 installation

    When install us Windows XP (SP3), our program in the will of the computer and lost the installation files?

    When install us Windows XP (SP3), our program in the will of the computer and lost the installation files?

    The answer is that all of your files, folders, and programs should remain in their normal form. However, backup your personal files is always a good idea.

  • Can you start and stop the glassfish server in JDeveloper 12 c and how?

    Mr President.

    Can you start and stop the glassfish server in JDeveloper 12 c and how?

    Concerning

    have you looked at

    http://www.Java-n-me.com/2014/02/GlassFish-extension-for-JDeveloper-12C-go-live.html

  • Is it possible to start and stop the servers without using nodemanager?

    Is it possible to start and stop the servers without using nodemanager? If so, how?

    Hello

    Please follow the link below, it will be useful

    http://docs.Oracle.com/CD/E1322201/wls/docs81/ConsoleHelp/startstop.html#1243161_

    Concerning
    Fabian

  • Administration of the system and the batch file

    Hi all

    I've linked a batchfile to be open in my pdf file, but every time I opened it from the link that a message pops up saying "refused by your system administrator."

    Can someone show me how to allow the batch file to open

    Thank you

    This is a security feature. To change which can be opened as an attachment, you must change the registry.  ETK preference reference has the information of the registry change you need.

    Spare part

  • Impossibile to "start Windows because the following file is missing or damaged. Windows system32 config system

    1. Impossibile to "start Windows because the following file is missing or damaged. Windows system32 config system

    The question was preceded by a loss of power, aborted reboot or abnormal termination? (This includes pulling and buttons power).

    These can cause corruption in the file system that must be fixed before you do anything else.

    If none of these events occurred (or even if they have not taken place), you must verify the integrity of your file system before anything else (especially "try" things).
    There is zero logic to start try to copy files to a hard drive with a corrupted file system so corruption of file system must be fixed first using the XP chkdsk program and run chkdsk can solve your problem completely.
    Use the XP Recovery Console to check the file system on your HARD drive and fix the problems and then try to start your system - this may be all you need to do.  Or, you are welcome to just start trying things that might work.
    Start the Recovery Console Windows using an XP bootable installation CD, or create a bootable CD from the Console of the Recovery XP (no XP media required).
    A CD of XP Recovery Console is not the same as the recovery disks that may have come to a store to purchase the system.
    If you have any bootable CD to run the XP Recovery Console or that you are not sure what type of bootable CD you have, can create a bootable XP Recovery CD of Console and don't forget (no support for XP not necessary).
    If you need instructions to create a bootable XP Recovery CD of Console, we can predict that too (just ask).
    After booting into the Recovery Console, you should be in this folder:
    C:\WINDOWS
    For each of your hard disk partitions, you must then run:
    Chkdsk /r
    For example, at the Recovery Console prompt, enter:
    CHKDSK c: /r
    Let chkdsk finish to correct the problems, he could find.  It may take a long time to complete or seem to be 'glued '.  Be patient.  If the HARD drive light flashes, it's something.  Keep an eye on the amount of the percentage to be sure that it is still making progress.  It may even seem to go back sometime.
    The chkdsk/r must be completed without error, you may need to run several times until it does.
    Remove the CD, and then type "exit" to exit the Recovery Console and restart the computer and the report with your progress.

  • Automatic execution of commands in the batch file

    When the batch file containing the following commands is executed, orders of the line 1, 2, and 3 are executed, but the 'TIME' command is executed after that I closed the "EXCEL." I want the command 'TIME' to be run automatically without needing to close the 'EXCEL '. Could you please suggest a way to do it.

    CLS

    TASKKILL /IM "" EXCEL. "." "EXE" / F

    C:\PROGRA~1\MICROS~2\Office14\EXCEL. EXE

    TIME

    The code must be in the following form:

    CLS

    TASKKILL /IM "" EXCEL. "." "EXE" / F

    Start/b C:\Progra~1\Micros~2\Office14\EXCEL. EXE

    TIME

  • See Planner 3.0 - Single-VM Test Local, the batch file runs, but the workload does not run

    Hi all

    See planner 3.0 running on vSphere 5.1. When I run the test local (Windows 7 x 64), see planner was able to power on

    the office and run the batch (server.bat) file, but the workload does not start. I checked the Planner view agent service

    is started on the desktop.


    Planner view device

    01.jpg

    GoldenDesktop, batch file is running

    02.JPG

    Any help would be appreciated.

    AJI

    Can you try to raise the rise time and see if the problem persists? There is also a log file in C: drive, c:\viewplanner-desktopagent.log--vous can attach this file?

Maybe you are looking for

  • silverlite update 02/09/10

    Hello, since this update I can not use my printer photosmart p h. He said that it is not compatible and the printer does not work. I have download the repair tool, check that it always stops on Quebec, I hit fix and it shows that it is fixed, but whe

  • Try to download the windows error message install 3.1 is "is not a valid win32 application.

    I'm missing some drivers and try to download it from the dell site.  Watch I need to install windows, but I can't seem to load. » The system is windows XP Home edition 2002 Service Pack 2

  • Print without margins of Pages (Mac) using Photosmart HP 5520

    Hello I try to print a document from Pages (MAC app) as an invitation without borders - in other words, I want the document to print right to the edge of the page. The document is 4 x 6 and I am printing paper is 4 x 6. I want the impression to be bo

  • MsMpEng.exe slows down my computer

    From time to time Windows Tak Manager shows that the MsMpEng.exe consumes a lot of time, often Reiver level of 50% and sometimes up to 92% of CPU. Leaving the task mamager long-running periods with CPU time showing MsMpEng.exe consumes by far the mos

  • Try to install LR6

    Have imac, with OS10.10.2.    "Setup" won't accept my password when I try to install LR6.