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

    • 26200 25H2 is shaping up to be a very solid and stable release, hardly any issues with it here on 3 different configurations of computers
    • Samsung Galaxy S25+ 512GB is $220 off for powerful AI and a pro-grade camera by Paul Hill Are you in the market for a premium Samsung phone? If so, check out the Samsung Galaxy S25+ with 512GB of storage. It’s on Amazon right now for just $899, down 20% from its $1,199.99 list price, representing a significant $220.99 saving. This unlocked device is marked as the number 1 new release by Amazon in the Cell Phones category. If you’re interested, act fast as it’s a limited-time deal. The Galaxy S25+ comes packed with AI features under the umbrella of Galaxy AI. Capabilities include Multiple Tasks with One Ask which brings Google Gemini integration for multi-app commands, Now Brief which proactively gives you information you need to start the day, Audio Eraser to remove distracting sounds from your videos, and advanced portrait features. Powering these features is the Qualcomm SM8750-AB Snapdragon 8 Elite (3 nm) processor which handles all sorts of tasks efficiently including gaming, translation, and photo editing. Alongside the processor is 512GB of storage and 12GB of RAM. The S25+ uses a 6.7-inch QHD+ ProScaler Display which delivers vibrant visuals thanks to its use of Dynamic AMOLED 2X with 3,120 x 1,440 resolution and 120Hz refresh rate. Regarding camera setup, the S25+ has an AI camera with 50MP main sensor, 12MP ultrawide, and 10MP telephoto with OIS. There is also a 12MP front camera. This camera setup is capable of 8K video recording, which is impressive. Finally, you get long battery life with the 4,900 mAh and 45W fast charging support so you don’t need to wait long for it to recharge. If you’re an Android user looking to upgrade to a flagship phone without paying the full price, this deal is for you. If you have an eligible phone to trade in, there is an option to do so to claim up to $725 on the upgrade with Amazon.com Gift Card credit. If you’re excited by AI, but your current phone doesn’t support many AI features, this phone could also be a smart choice. Its display is also great for media consumption, and the processor is robust. Finally, if you have a lot of files to store, the 512GB of storage should be ample. Samsung Galaxy S25+ (Icyblue): $899 (Amazon US) / MSRP $1,199.99 This Amazon deal is US-specific and not available in other regions unless specified. If you don't like it or want to look at more options, check out the Amazon US deals page here. Get Prime (SNAP), Prime Video, Audible Plus or Kindle / Music Unlimited. Free for 30 days. As an Amazon Associate, we earn from qualifying purchases.
    • Sniffnet 1.4.0 by Razvan Serea Sniffnet is a network monitoring tool to help you easily keep track of your Internet traffic. Whether you want to gather statistics, or you need to inspect more in depth what's going on in your network, this app will get you covered. Sniffnet is a technical tool, but at the same time it strongly focuses on the overall user experience: most of the network analyzers out there are cumbersome to use, while one of Sniffnet's cornerstones is to be usable with ease by everyone. Furthermore, Sniffnet is completely free and open-source, dual-licensed under MIT or Apache-2.0: if you are interested you can find the full source code on GitHub. Last but not least, this application is totally developed in Rust: a modern programming language to build efficient and reliable software, emphasizing performance and safety. Sniffnet key features choose a network adapter of your PC to inspect select a set of filters to apply to the observed traffic view overall statistics about your Internet traffic view real-time charts about traffic intensity keep an eye on your network even when the application is minimized export comprehensive capture reports as PCAP files identify 6000+ upper layer services, protocols, trojans, and worms find out domain name and ASN of the hosts you are exchanging traffic with identify connections in your local network discover the geographical location of the remote hosts save your favorite network hosts inspect each of your network connections in real time set custom notifications to inform you when defined network events occur choose the style that fits you the most, including custom themes support ... and more! Sniffnet 1.4.0 changelog: New features Import PCAP files (#795 — fixes #283) Enhanced notifications (#830 — fixes #637) Donut chart reporting overall traffic statistics (#756 — fixes #687) Added support for ARP protocol (#759 — fixes #680) Identify and tag unassigned/reserved "bogon" IP addresses (#678 — fixes #209) Show data agglomerates in Inspect page table (#684 — fixes #601) Added Traditional Chinese (Taiwan) translation 🇹🇼 (#774) Added Indonesian translation 🇮🇩 (#611) A Docker image of Sniffnet is now available (#735) Improvements Added new themes A11y (Night) and A11y (Day) based on palettes optimized for Accessibility (#785 — fixes #786) Do not apply new notification thresholds while user is typing them (#777 — fixes #658) Show more information when domain name is short (#720 — fixes #696) Avoid directory traversal when selecting file name for PCAP exports (#776 — fixes #767) Add icon to window title bar (#719 — fixes #715) Update footer buttons and links (#755 — fixes #553) Handle errors to reduce the number of possible crash occurrences (#784) Updated some of the existing translations to v1.3: Portuguese (#690) Ukrainian (#692) Spanish (#805) Fixes Fix crates.io package for Windows (#718 — fixes #681) Fix crash when inserting characters longer than one byte in the text input for byte threshold notification setting (#747 — fixes #744) Remove pre-uninstall script on Linux (fixes #644) Fix typo in Russian translation (fixes #730) Minor fix to service determination algorithm in case of multicast and broadcast traffic Download: Sniffnet 64-bit | Sniffnet 32-bit ~15.0 MB (Open Source) Link: Sniffnet Home Page | Other operating systems | Screenshot Get alerted to all of our Software updates on Twitter at @NeowinSoftware
    • Anker announces global recall of five power bank models over fire safety risks by Aditya Tiwari The Chinese electronics brand, Anker Innovations, known for its mobile accessories and power banks has announced a voluntary global recall of five power bank models. The decision comes after the company spotted a potential fire hazard issue with lithium-ion battery cells from a particular vendor. Anker said that it put up a series of quality checks to detect manufacturing issues early in the production cycle, which include component level-audits and supplier testing. The company assured that "while the likelihood of malfunction is considered minimal, out of an abundance of caution, we have decided to initiate a voluntary global recall of several Anker power bank models." Here's the list of the Anker Power Bank models chosen for the global recall: Model A1257 - Anker Power Bank (10K, 22.5W) Model A1647 - Anker Power Bank (20,000mAh, 22.5W, Built-In USB-C Cable) Model A1652 - Anker MagGo Power Bank (10,000mAh, 7.5W) Model A1681 - Anker Zolo Power Bank (20K, 30W, Built-In USB-C and Lightning Cable) Model A1689 - Anker Zolo Power Bank (20K, 30W, Built-In USB-C Cable) If you think you own one of the affected power banks, you can check the model number located on the back or side of your power bank. After that, you can fill out the recall form to start the process and verify the serial number of your affected device. If your power bank is eligible for the recall, you can either get a replacement or receive a gift card for use on the Anker website. It's not offering any refunds in the US at the moment. Anker advises that you should stop using an impacted power bank immediately even if the device functions normally right now. A unit confirmed for the recall could pose the risk of overheating, melting, smoke, or fire. This is the second major recall from Anker in the same month after more than a dozen reports of fires and explosions. The company previously recalled over one million Anker PowerCore 10000 (A1263) power bank units, citing fire safety risks due to a potential issue with the Lithium-ion battery. These power banks were sold in the US from January 1, 2016 through December 31, 2022.
  • Recent Achievements

    • Collaborator
      Mighty Pen went up a rank
      Collaborator
    • Week One Done
      emptyother earned a badge
      Week One Done
    • Week One Done
      DarkWun earned a badge
      Week One Done
    • Very Popular
      valkyr09 earned a badge
      Very Popular
    • Week One Done
      suprememobiles earned a badge
      Week One Done
  • Popular Contributors

    1. 1
      +primortal
      567
    2. 2
      +FloatingFatMan
      189
    3. 3
      ATLien_0
      176
    4. 4
      Skyfrog
      112
    5. 5
      Xenon
      110
  • Tell a friend

    Love Neowin? Tell a friend!