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
https://www.neowin.net/forum/topic/266875-start-and-stop-programs-with-batch/
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.

  zeta said:
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...

  Quote
@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.

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

  Quote
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.

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)

  cpugeniusmv said:
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.

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

  Quote
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

  Quote
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"

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 ;)

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
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • Par for the course. I asked a question a few days ago and was threatened to be reported. 😂
    • Ummmm Are you kidding? Do think these books being sold are disclosing they are AI written?
    • i'm just commenting because of this madness. you simply asked "what crowd" which i too am genuinely curious about, only to receive a response in the form of a link that directs to an analysis of the audited financial statements with the accompanying notes. then you say that the guy who wrote it is stupid, which whatever, that's not an argument being discussed atm, only to receive a response from Arceles saying "i don't deal with people whose first response is an ad homenim". jesus. this is like making a claim, and then saying "i don't deal with people who speak in a certain way or swear so i'm not gonna answer you hah!" (said in a nasaly voice, not trying to depict you Arceles). then focus on the argument instead of the explanation begins... "so what don't you like about the guy (lunduke)" followed by "he just likes to insult people" and the explanation for the "crowd" being referred to was never even established. so a request for an explanation about the crowd turned into an argument about "why do you think lunduke is an idiot". wowza.
    • Sony lays off 30% of staff from Days Gone developer Bend Studio by Pulasthi Ariyasinghe Another wave of layoffs has hit the game developer space, and this time, it's a first-party Sony studio that's been affected. Following a report by Bloomberg's Jason Schreier, Bend Studio has confirmed that it is letting go of "incredibly talented teammates" as it begins work on a new game project. "Today, we said goodbye to some incredibly talented teammates as we transition to our next project," said Bend Studio in a social media post today. "We're deeply thankful for their contributions as they've shaped who we are, and their impact will always be part of our story." Bend Studio is most well-known for its 2019-released open-world zombie adventure Days Gone, which even received a remaster just a few months ago. Prior to that, the studio had been responsible for the classic Syphon Filter series while also developing several PlayStation Portable and Vita games like Resistance: Retribution and Uncharted: Golden Abyss, respectively. "This is a difficult moment for our team, but we hold immense respect for everyone who got us here," the company added. "As we move forward, we remain committed to building the future of Bend Studio with creativity, passion, and innovation in the titles we craft." While Sony did not detail just how many staff have been affected by this latest decision, Jason Schreier revealed that 30% of the studio is being laid off. This amounts to around 40 people, according to the reporter. Earlier this year, Sony canceled two live service games that were in development at Bend Studio and Bluepoint Games. It was never revealed what this mystery game was supposed to be. "Bend and Bluepoint are highly accomplished teams who are valued members of the PlayStation Studios family," Sony said at the time. It's unclear if Bluepoint, which had been developing a God of War live service experience, will soon be hit by its own wave of layoffs too.
    • KataLib 4.5.3.0 by Razvan Serea KataLib is more than just a music player — it's a complete audio suite designed for music lovers and creators alike. It combines a powerful audio player, a flexible metadata editor, a capable audio converter, and a music library manager into one streamlined application. Core Features: Audio Player Enjoy seamless playback of virtually any audio format or even streaming video files. DJ Mode lets you mix tracks with manual or automatic crossfades. You can also load and save WinAmp-style playlists for quick access to your favorite sets. Audio Converter Convert between a wide range of audio formats effortlessly. Trim or normalize your output automatically, and even extract audio from streaming video sources. Ideal for preparing files for different devices or platforms. Metadata Editor View and edit ID3v2 tags and other metadata. Batch edit multiple files at once, and fetch missing information directly from the MusicBrainz database. You can also apply or update album art with ease. Music Library Manager Organize your entire audio collection, search across tracks instantly, and download cover images from the internet — or use your own custom artwork. KataLib makes it easy to keep your library tidy and enriched with useful info. Supported Formats: KataLib supports a wide range of both lossy and lossless audio formats: Input: OPUS, AAC, FLAC, M4A, MP3, MP4, MPC, APE, AIF, MKV, AVI, MOV, FLV, WEBM, Ogg Vorbis, WAV, WAVPack, WMA Output: OPUS, FLAC, M4A, MP3, Ogg Vorbis, WAV Under the hood, KataLib uses the trusted FFmpeg engine for audio conversion and media playback, ensuring compatibility with virtually all mainstream media formats. Download: KataLib 4.5.3.0 | 64.5 MB (Open Source) Links: KataLib Home Page | Github | Screenshot Get alerted to all of our Software updates on Twitter at @NeowinSoftware
  • Recent Achievements

    • First Post
      K Dorman earned a badge
      First Post
    • Reacting Well
      rshit earned a badge
      Reacting Well
    • Reacting Well
      Alan- earned a badge
      Reacting Well
    • Week One Done
      IAMFLUXX earned a badge
      Week One Done
    • One Month Later
      Æhund earned a badge
      One Month Later
  • Popular Contributors

    1. 1
      +primortal
      545
    2. 2
      ATLien_0
      268
    3. 3
      +FloatingFatMan
      207
    4. 4
      +Edouard
      201
    5. 5
      snowy owl
      139
  • Tell a friend

    Love Neowin? Tell a friend!