You can disable programs that start with Windows in MSConfig. If you prefer to kill a process through batch file you can use the taskkill command:

taskkill /f /im processname.exe
Answer from stderr on Stack Exchange
Discussions

How to stop process from .BAT file? - Stack Overflow
So I have process I started from one bat file. How to stop it from another? ... This will ask it to close, but it may refuse, offer to "save changes", etc. If you want to forcibly kill it, try: More on stackoverflow.com
🌐 stackoverflow.com
Force Kill Bat File STARTS Program
An error I can see is that it is a string, not a variable. Also, assuming you are using the image name 1) go to task manager and check the "details" tab to make sure you have the right process name. If it is indeed "valheim_server.exe" then it should just be TASKKILL /F /IM valheim_server.exe More on reddit.com
🌐 r/Batch
5
2
December 29, 2022
close/kill another Windows process which is started by run a .bat in Qt app
any way to close/kill another Windows process which is started by run a .bat in Qt app? More on forum.qt.io
🌐 forum.qt.io
18
0
June 10, 2019
End a Process With a BAT File
Find answers to End a Process With a BAT File from the expert community at Experts Exchange More on experts-exchange.com
🌐 experts-exchange.com
June 28, 2012
🌐
Pathetic Cockroach
notepad.patheticcockroach.com › 4535 › killing-processes-in-windows-with-a-batch-script
Killing processes in Windows with a batch script – PCR's notepad
August 29, 2019 - It will kill all processes from executable calc.exe, immediately. If it’s always the same program causing issue, you can just put it in a batch file (.bat) and run it whenever you need.
🌐
Eleven Forum
elevenforum.com › windows support forums › general support
Is it possible to end a task/process using a .bat file in Windows 11? | Windows 11 Forum
March 3, 2023 - It was one of my life's simple joys to click one thing— actually, I press 1 macro key on my keyboard, which executed a .bat file —and close the game I was playing, my voice controls for the game, my voice chat program, and any other related software. An example of my old .bat file looked like this: ... @echo off @echo Terminating chosen processes...
🌐
Server Fault
serverfault.com › questions › 664202 › batch-file-that-kills-a-certain-process
windows - Batch file that kills a certain process - Server Fault
February 1, 2015 - I am using the following script to kill a process in CLOSE_WAIT state that listens to a certain ip and to a certain port. FOR /F "tokens=5 delims= " %%I IN ( 'netstat -ano ^| find "127.0.0.1:5...
🌐
YouTube
youtube.com › automate with rakesh
Batch Script to Kill Process - YouTube
Learn to create a batch script that kill process.A batch file is a script file that stores commands to be executed in a serial order. It helps automate routi...
Published   November 27, 2022
Views   6K
Find elsewhere
🌐
GitHub
gist.github.com › farshidrezaei › 1e288ae963dc7cffed52b568031dfc1c
Bat file for kill and stop a port or process. · GitHub
Bat file for kill and stop a port or process. GitHub Gist: instantly share code, notes, and snippets.
🌐
Windows 10 Forums
tenforums.com › general-support › 184034-batch-kill-all-processes-same-name.html
Batch kill all processes with the same name - Windows 10 Help Forums
August 18, 2021 - You could set up a simple batch file which loops the Taskkill command as in the following example, which loops it every second (you can change the interval by changing the value after the timeout /T command). ... :DoAgain TaskKill /IM Chrome.exe /T /F timeout /t 1 GOTO :DoAgain Although this or other methods of killing multiple instances of a non-behaving program can work, it would be more appropriate to try and track down the root cause of the problem.
🌐
YouTube
youtube.com › watch
How to kill a Process with a batch file - YouTube
In this redone video steven will be showing you how to properly write a batch file that kills multiple process at once.Our website will be re-released early ...
Published   October 7, 2010
🌐
Jacobmsaylor
jacobmsaylor.com › kill-multiple-running-processes-using-a-batch-file
Kill Multiple Running Processes Using a Batch File – Tech Talk
Compile a list of the processes you need to kill. If you do not know the name do the following : Right click the task bar and select Start Task Manager ... Find your process and copy the Image Name. If there is a *32 at the end of the process, ignore it. ... Enter as many lines as needed with the following format : TASKKILL /F /IM “[Application Name.exe]” · Save and run your batch file.
🌐
GitHub
gist.github.com › ndarville › e455de123a6683320d7b70a40855299d
Batch script for videogames to kill processes hogging resources · GitHub
Save the contents of killresourcehogs.bat to a file (named whatever.bat) and just double-click on it to end the listed processes.
🌐
Reddit
reddit.com › r/batch › force kill bat file starts program
r/Batch on Reddit: Force Kill Bat File STARTS Program
December 29, 2022 -

I've given up but I provide this to you for entertainment purposes and the vain hope that maybe some of the mystery gets answered.

I run a dedicated Valheim Server on my Windows 10 computer but I want to shut it off every night at a set time. So I figured I'll set up a bat file to close it for me so I don't have to close it myself. The bat file opens a new instance of command prompt... instead of closing literally anything.

I've tried so many different commands.

@echo off

taskkill /F /PID %valheim_server.exe%

taskkill /F /PID %UnityCrashHandler64.exe%

taskkill /F /PID %conhost.exe%

taskkill /F /PID %cmd.exe%cls

or

taskkill /IM <fullfilepath>

or

taskkill /F /IM <fullfilepath>

or

taskkill /IM <fullfilepath> /F

or

taskkill /IM <fullfilepath> /F

or

taskkill /IM <processname>

or

taskkill /F /IM <processname>

or

taskkill /IM <processname> /F

I've tried just killing the cmd.exe or just killing the valheim_server.exe and both times it STARTS a new instance of cmd.exe, albeit blank with nothing in it. Just the blinky cursor. Running it again just keeps opening more instances. I WANT IT TO CLOSE THINGS, NOT OPEN THEM. Is the internet just trolling me when they said /IM or /F were supposed to close things?

I initially tried just making a scheduled task for my computer to shut itself off but that did absolutely nothing (Edit - I have since fixed that problem). I don't have the brain power to try to figure out exactly what happens when I close the program manually and making a bat file to execute those commands via a .bat file. Those four tasks are listed in the Task Manager in a process group.

I miss Windows XP.

🌐
GitHub
github.com › fkie-cad › windowsScripts › blob › master › killProcess.bat
windowsScripts/killProcess.bat at master · fkie-cad/windowsScripts
:: Kill a running process by name or pid · :: :: Version: 1.0.1 · :: Last change: 17.12.2021 · :: · · @echo off · setlocal enabledelayedexpansion · · set prog_name=%~n0 · set my_dir="%~dp0" set "my_dir=%my_dir:~1,-2%" · set /a chk=0 · set /a kll=0 ·
Author   fkie-cad
🌐
Technibble
technibble.com › home » › blog » › computer technician tools » › kill all running apps .bat
Kill All Running Apps .BAT - Technibble
August 27, 2015 - This .BAT file will kill all running apps on your computer. Very useful if there are too many processes running in the background that is slowing down the PC
🌐
Experts Exchange
experts-exchange.com › questions › 27773474 › End-a-Process-With-a-BAT-File.html
Solved: End a Process With a BAT File | Experts Exchange
June 28, 2012 - I tried it. It did not end the process. EARN REWARDS FOR ASKING, ANSWERING, AND MORE. Earn free swag for participating on the platform. ... What does it say when you run the bat file? Put a pause at the end of the file if needed so you can read the errors.
🌐
Reddit
reddit.com › r/askprogramming › can i write a batch file to kill and restart a specific program?
r/AskProgramming on Reddit: Can I write a batch file to kill and restart a specific program?
November 29, 2023 -

I have this old, old purpose-built piece of software at my job that I'm guessing IT tried to modify so that it would time out if you were inactive too long. But instead of a countdown or a pop-up, it just stops responding after a while, forcing me to open the task manager, force stop, re-launch it, et cetera. In theory it'll sort itself out if you wait, but it's way faster to just kill it.

Is there a way to write a little script or batch file or something that I can keep on my desktop that'll do all that for me with a double click?

🌐
Experts Exchange
experts-exchange.com › questions › 25048513 › Killing-Process-Using-Batch-Script.html
Solved: Killing Process Using Batch Script | Experts Exchange
January 12, 2010 - I am using following command kill a process but its not working. taskkill /f /im /t wowexec.exe tskill wowexec.exe /a /v processes.png ... We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads. ... is your batch script being run as administrator?