ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

Main Area and Open Discussion > General Software Discussion

looking for a program to close other program in a batch

<< < (2/2)

Shades:
1 - Open a command shell
2 - In this window use 'sc' to find out the names of the services you want to turn off
3 - Either in this window or in the normal Windows GUI, create a .bat file
4 - In this file for each of the services you want to stop, fill in the following:
     NET STOP <service name>
5 - Create a shortcut to this file to your desktop or wherever you want to store it

When the time comes to play a game/see a movie/whatever, use the shortcut or execute the .bat file, which will work always. If you have only one version of Windows in your LAN/set of computers, you can copy this file without problems to each system and it will work as well.

When you need to enable the turned-off services, see the previous mentioned steps and replace step 4 with:
NET START <service name>

If you run multiple versions of Windows, check for each version the services you want to stop and just add them to the previously created files.

Nothing more to it, this solution works always in every version of Windows, from now till kingdom come (darn, one day too late... ;)).


rjbull:
Taskill v1.02 [6kB] (freeware).
Taskill is a process viewer and killer. It works in GUI or CLI mode and can kill multiple instances of the same task in one go.

--- End quote ---

I don't doubt you could do it with PowerPro, too...  but don't ask me how.

MilesAhead:
Just make a kill file one name per line.
Just use exe name without path such as "notepad.exe"

You can easily spiff up this AutoIt3 code with a few niceties.


--- ---
#include <file.au3>
Dim $aRecords
If Not _FileReadToArray("KillFile.txt",$aRecords) Then
   MsgBox(4096,"Error", " Kill File to Array     error:" & @error)
   Exit
EndIf
For $x = 1 to $aRecords[0]
    While ProcessExists($aRecords[$x])
ProcessClose($aRecords[$x])
Sleep(250)
Wend
Next

edit: this is just for regular exe files.  Follow Shades advice for services etc..
edit2: changed it to a While loop in case there are multiple instances of a process.
edit3: If you want to have some fun with it, very easy to pass the name of the kill file on the command line.  See AutoIt3 help section Running Scripts for how to use $CmdLine.

Bionic71:
This program lets you close all running applications with just a single click.

http://www.ntwind.com/software/utilities/close-all.html

Renegade:
No smart comments about the reset button? Shucks...  :'(

;)

Navigation

[0] Message Index

[*] Previous page

Go to full version