start and stop programs with batch?


Recommended Posts

i wanna write a batch or some sort of script that will kill a given set of programs before i play a game, and then be able to double click another bat file that will launch all of those programs again after the game.

i figured out how to use the @call command to launch one program, but it doesnt wanna just continue on to the next program. any help or ideas? thanks.

Link to comment
Share on other sites

Starting those programs can be accomplished by using "start" in NT/2k/XP--it'll spin-off another shell to execute that program, so you can continue on with what you're doing. I'm not sure about the reverse though--it'd be difficult to obtain the process ID's of the processes you want to terminate.

Link to comment
Share on other sites

Starting those programs can be accomplished by using "start" in NT/2k/XP--it'll spin-off another shell to execute that program, so you can continue on with what you're doing. I'm not sure about the reverse though--it'd be difficult to obtain the process ID's of the processes you want to terminate.

585233412[/snapback]

when i use the start command it just opens up command prompt windows. here is my batch file so far...

@start "C:\Program Files\GetRight\getright.exe"

@start "C:\Program Files\Palm\HOTSYNC.EXE"

@start "C:\Program Files\Pixoria\Konfabulator\Konfabulator.exe"

@start "C:\Program Files\Stardock\ObjectDock\ObjectDock.exe"

oh and i found an app that kills a program based on its name and if i can figure out how to execute all of these programs i can write that up as launching a program in the batch file.

Link to comment
Share on other sites

ah, i figured it out... for anyone that wants it...

cd "C:\Program Files\GetRight"

start getright

cd "C:\Program Files\Palm"

start HOTSYNC

cd "C:\Program Files\Pixoria\Konfabulator"

start Konfabulator

cd "C:\Program Files\Stardock\ObjectDock"

start ObjectDock

thats the sorta syntax you gotta use. works like a charm.

Link to comment
Share on other sites

try this:

@start "" "C:\Program Files\GetRight\getright.exe"
@start "" "C:\Program Files\Palm\HOTSYNC.EXE"
@start "" "C:\Program Files\Pixoria\Konfabulator\Konfabulator.exe"
@start "" "C:\Program Files\Stardock\ObjectDock\ObjectDock.exe"

the reason for the extra quotes is because the first set of quotes indicates the Text for the Titlebar of the command window.

to kill a task:

taskkill /f /im mspaint.exe

(note: i believe taskkill only comes with XP Pro)

Link to comment
Share on other sites

taskkill /f /im mspaint.exe

(note:  i believe taskkill only comes with XP Pro)

585233984[/snapback]

Don't work in Windows 2003 STD :blink:

ERROR: The remonte system must be running Windows 2000 or above.

Link to comment
Share on other sites

How to stop Running Processes (includes symantec,avg and sygate)

(they must have the same name as described in services. the below removes access to internet also.

All inorder to free up resources for better game/application work

completly safe

run the lower one (start) to restart them

NET STOP "Cryptographic Services"

NET STOP "DHCP Client"

NET STOP "DNS Client"

NET STOP "Network Connections"

NET STOP "Norton AntiVirus Auto Protect Service"

NET STOP "Print Spooler"

NET STOP "Protected Storage"

NET STOP "Remote Access Auto Connection Manager"

NET STOP "Shell Hardware Detection

NET STOP "Symantec Event Manager"

NET STOP "Task Scheduler"

NET STOP "Themes"

NET STOP "Windows Management Instrumentation"

NET STOP "Windows Time"

NET STOP "AVG7 Alert Manager Server"

NET STOP "AVG7 Update Service"

NET STOP "Sygate Personal Firewall Pro"

@PAUSE

Start Processes again

NET START "Cryptographic Services"

NET START "DHCP Client"

NET START "DNS Client"

NET START "Network Connections"

NET START "Norton AntiVirus Auto Protect Service"

NET START "Print Spooler"

NET START "Protected Storage"

NET START "Remote Access Auto Connection Manager"

NET START "Shell Hardware Detection

NET START "Symantec Event Manager"

NET START "Task Scheduler"

NET START "Themes"

NET START "Windows Management Instrumentation"

NET START "Windows Time"

NET START "AVG7 Alert Manager Server"

NET START "AVG7 Update Service"

NET START "Sygate Personal Firewall Pro"

Link to comment
Share on other sites

Or you use FSAutoStart from http://www.kensalter.com/fsautostart/

Description:

FSAutoStart gives the user the ability to automatically shutdown services and programs to provide as much resources to running today's most demanding games and applications.  It also provides the ability to launch selected programs after the selected application is launched.  Lastly, it can automatically restart those programs and services previously shutdown, thus bringing the computer back to its original state.  It also adds performance enhancing options like Defragment Memory.

It?s Free ;)

Link to comment
Share on other sites

Well my batch file kills all services and programs then launchs my game and then waits for the game to quit and then automatticly relaunchs all services and programs. Its done with the /wait or /w switch. hehe

So only have to run batch once. And I hide the window using ConsoleTool /HIDE. Search google. ;) I also perfer to use process -q and process -k. Again google. ;)

Well since all the services where already posted above here is just a sample, part of my quake 3 config.


@echo off
ConsoleTool /HIDE
Start /d"E:\Program Files\Quake III Arena" Minimizer.exe
Start /d"E:\Program Files\Quake III Arena" gapa.exe
CHOICE.COM /N /CY /TY,4 >NUL
Start /w /d"E:\Program Files\Quake III Arena" quake3.exe +set fs_game q3ut3 +nosplash +set com_hunkmegs 128 +com_zoneMegs 32 +com_soundmegs 8 +seta s_khz "22" +_windowed_mouse 1 -dinput
CHOICE.COM /N /CY /TY,3 >NUL
process -q Minimizer.exe
CHOICE.COM /N /CY /TY,3 >NUL
process -k gapa.exe
cls

Thats the better way to use start, notice no cd bs. :)

Oh and I use CHOICE.COM too which pauses the batch file for time. Again google it.

Edited by war
Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.