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

    • Rufus 4.8 brings performance boost for Windows ISOs by Sayan Sen Rufus, perhaps the most popular bootable USB media creation utility, has received a significant update with version 4.8. That's because there is a major shift toward faster and more efficient processing of Windows installation media by switching to wimlib for all Windows Imaging (WIM) handlings. The Rufus author says that the change has led to a significant improvement in speed when opening Windows ISOs, and this should be great for such users who tend to work with Windows installation files fairly regularly. Rufus notes that Wimlib’s integration speeds up the Windows ISO processing, reducing waiting times during image analysis. This boost in speed is said to be particularly noticeable when creating Windows To Go drives, although if you have a "crap" drive, it is best not to expect "miracles". For those wondering, Wimlib is an open source library for creating, extracting, and modifying Windows Imaging (WIM) archives, and it is cross platform too. Another key update in Rufus 4.8 is the introduction of file splitting for files over 4GB using the Alt-E key, for managing larger installation files; however, performance gains in this area are still modest when compared to the UEFI:NTFS handling. On the development side, Rufus 4.8 has moved exclusively to Visual Studio binaries. The full changelog is given below: Switch to wimlib for all WIM image processing: Greatly speeds up image analysis when opening Windows ISOs Can speed up Windows To Go drive creation Might help with Parallels limitations on Mac (But Rufus on Parallels is still unsupported) Enables the splitting of >4GB files with Alt-E (But still WAY SLOWER than using UEFI:NTFS) Switch to using Visual Studio binaries everywhere, due to MinGW DLL delay-loading limitations Add more exceptions for Linux ISOs that restrict themselves to DD mode (Nobara, openSUSE, ...) Improve reporting of UEFI bootloaders in the log, with info on the Secure Boot status Fix an issue with size limitations when writing an uncompressed VHD back to the same drive Fix a crash when opening the log with the 32-bit MinGW compiled version Fix commandline parameters not being forwarded to original Windows setup.exe To download Rufus 4.8, head over to Neowin software stories page. You can also download it from the official website or from its GitHub repo.
    • That's very interesting, thanks for the link!
    • When I hear "shady" I assume there is some element of being dishonest. There is nothing directly dishonest about publishing a crappy book, people have done that long before AI...it just took a lot more time. I am not about the proliferation of AI slop, so I hate this, but I wouldn't call it shady.
    • Soon(TM). When Elon Musky claims something is coming soon, that means 4-5 years late, 50% more expensive and still buggy as hell. Why are people still drinking his Koolaid? Also how stupid are investors still throwing at Tesla and Elon for all these years while they deliver no god damn results? Where are ever promised Robotaxies? Where is the Semi? Where is the Roadster? We already know the outcome of the Cybercock garbage container. Like, how stupid you have to be to still invest ANY money into Elon Musks stupidities?
    • Google Workspace brings 10 free AI features for nonprofit organizations by Aditya Tiwari Google has announced several updates for nonprofit and charitable organizations that use its products and services. For starters, the search giant is expanding the Google for Nonprofits program to more than 100 countries globally. Google for Nonprofits has been around for over a decade, offering products and services to eligible nonprofits for free or at discounted rates. One of its verticals is Workspace for Nonprofits, a paid tier that provides nonprofits with no-cost access to Gmail, Calendar, Meet, and its AI apps, such as Gemini and NotebookLM. Google is bringing ten new AI features to the Workspace for Nonprofits tier as part of its new updates. The company surveyed over 9,000 nonprofit organizations earlier this year and said that about nine out of ten nonprofits reported positive productivity gains when using AI apps and features. However, only one out of five reported that at least half of their organization uses AI. That said, these are the new features coming to Workspace for Nonprofits without paying any money: Gems Audio Overviews in Gemini app Image generation with people in Gemini app Canvas and quizzes in Gemini app Deep Research in Gemini app Google Vids with custom video clips powered by Veo 2 Two-way conversations with Gemini Live NotebookLM with Summaries, Audio Overviews (50+ languages and length adjustment) and Q&A Mind Maps in NotebookLM Discover Sources in NotebookLM Most of these features are available in other Workspace plans intended for regular businesses. Google's Nonprofits tier supports up to 2,000 employees or volunteers at $0/user/month, who can have professional email addresses, take part in 150-participant video meetings, and share a pooled cloud storage capacity of 1TB. Additionally, nonprofits can also place ads in Google Maps to connect with people at a local level. The company said that it's "expanding Ad Grants to run on eligible Google Maps placements in Performance Max campaigns free of charge." These ads in Google Maps can appear above, below or beside search results.
  • Recent Achievements

    • Apprentice
      Cole Multipass went up a rank
      Apprentice
    • Posting Machine
      David Uzondu earned a badge
      Posting Machine
    • One Month Later
      Stokenking earned a badge
      One Month Later
    • One Month Later
      Kevin Jones earned a badge
      One Month Later
    • Week One Done
      Kevin Jones earned a badge
      Week One Done
  • Popular Contributors

    1. 1
      +primortal
      526
    2. 2
      ATLien_0
      260
    3. 3
      +Edouard
      194
    4. 4
      +FloatingFatMan
      180
    5. 5
      snowy owl
      134
  • Tell a friend

    Love Neowin? Tell a friend!