QuakeWiki
August 5, 2019

Forums

Welcome Guest

Pages: 1
Kill Everything
OneMadGypsyPostSeptember 20, 2018, 11:24
Moderator
Posts: 307
Registered:
November 12, 2017, 00:13
Hot topicKill Everything

Do you have a computer with limited resources? Have you watched Firefox, Chrome or something else freeze just to eventually get the Task Manager to open and realize there are numerous instances of the program running? Have you wished that "end task" did not "eventually" work? If so, I am here to help.

Make a bat file and paste this in it. Clicking the bat will kill ALL instances of firefox.

Taskkill /T /F /IM firefox.exe & cmd

Do you want to kill more things all at once? Well, you can. Using the below formula. Basically you just keep adding /IM nameOfProgram.exe before the ampersand.

Taskkill /T /F /IM firefox.exe /IM chrome.exe & cmd

Do you wish you could create a list of things to kill and choose from the list? Well, you can do that too by modifying the below to suit your needs. Basically, I just took everything that tends to build up processes on MY system and created a choice list for killing them.

@ECHO off

:START
ECHO.
ECHO Compile %type% and:
ECHO 1. Kill All Haxelib
ECHO 2. Kill All Neko
ECHO 3. Kill All Haxelib And Neko
ECHO 4. Kill All Firefox
ECHO 5. Kill All Chrome
ECHO 6. Kill All Firefox And Chrome
ECHO 7. Kill Everything

set /p choice=Choose a number and press enter: 
if not "%choice%"=="" set choice=%choice:~0,1%
if "%choice%"=="1" goto HAXELIB
if "%choice%"=="2" goto NEKO
if "%choice%"=="3" goto HAXENEKO
if "%choice%"=="4" goto FIREFOX
if "%choice%"=="5" goto CHROME
if "%choice%"=="6" goto FIREFOXCHROME
if "%choice%"=="7" goto KILLALL
ECHO "%choice%" is not valid, try again

ECHO.
goto START

:HAXELIB
Taskkill /T /F /IM haxelib.exe & cmd

:NEKO
Taskkill /T /F /IM neko.exe & cmd

:HAXENEKO
Taskkill /T /F /IM haxelib.exe /IM neko.exe & cmd

:FIREFOX
Taskkill /T /F /IM firefox.exe & cmd

:CHROME
Taskkill /T /F /IM chrome.exe & cmd

:FIREFOXCHROME
Taskkill /T /F /IM firefox.exe /IM chrome.exe & cmd

:KILLALL
Taskkill /T /F /IM firefox.exe /IM chrome.exe /IM haxelib.exe /IM neko.exe & cmd

Enjoy.

NOTE: It is quite possible that I get away with referring directly to the program without any path because all of these programs exist in the Environmental PATH variable. If you want to make a killSwitch for a program that is NOT in the Environmental PATH variable you may need to either cd (change directory) or refer directly to the program path. If you don't know how to do this just google something like "bat cd". There will probably be like 7 gabillion results that all say the same thing.

Alternately, if I am correct about the Environmental PATH, you could just put a killswitch bat in the folder that has the program in it and refer to it directly. Then simply make a desktop shortcut to it. If you wanted to make a list of choices and still use this method for each non-environmental program, you would simply make your list call the proper shortcut.

So, instead of (example)

:LABEL
Taskkill /T /F /IM myProgram.exe & cmd

You would do something like

:LABEL
myShortcut
EXIT

And the bat your shortcut leads to would have something like the below in it

Taskkill /T /F /IM myProgram.exe & cmd

The driving force behind me instantiating this possibility is that the task manager only lets me end one process at a time. After 20 tests I would have 20 neko.exe's running or maybe 20 haxelib.exe's or maybe just a shit-load of both. Select, End Task, Select, End Task, Select, End Task .... was making me mad. I wanted to end them all in one click and this method does exactly that. Well, it ends them all in a double-click ... good enough.

OneMadGypsyPostSeptember 20, 2018, 11:35
Moderator
Posts: 307
Registered:
November 12, 2017, 00:13
Hot topicReply To: Kill Everything

All I did was run my bat and select 4 (kill all firefox) as the second image shows, and instantly there was no more firefox. I made the images clickable for full size so you can read them.

before
[su_lightbox type="image" src="https://i.imgur.com/yOQO2Lb.jpg"]
Image
[/su_lightbox]
after
[su_lightbox type="image" src="https://i.imgur.com/OWWChis.jpg"]
Image
[/su_lightbox]

edit: lol, I just realized my list says "compile and" followed by the kill choices. That's because I just copied and pasted my choice list from a bat I made for compiling maps, and changed all the choices/labels to match what I need this to do. It's just some arbitrary text. There is no compiling of anything going on and that part can be deleted or changed.

this part ~ line 5: ECHO Compile %type% and:

ijazzPostSeptember 23, 2018, 09:51
Rookie
Posts: 11
Registered:
August 9, 2018, 15:17
Hot topicReply To: Kill Everything

For some reason the name of this thread reminded me of Eminem's "Kill You".

TalisaPostSeptember 26, 2018, 22:06
Insider
Posts: 93
Registered:
July 22, 2018, 00:35
Hot topicReply To: Kill Everything

thanks for this

ever since that new 'quantum' update firefox has been having a habbit of devouring loads of RAM,
and sometimes randomly starting to devour gigabytes of it like as if it were popcorn.

its nice to have a quick easy way to just insta-murder all instances of firefox in such a case
where firefox randomly decides its time to start devouring all of my RAM

OneMadGypsyPostSeptember 26, 2018, 22:39
Moderator
Posts: 307
Registered:
November 12, 2017, 00:13
Hot topicReply To: Kill Everything

Is it ridiculous or what? I mean WTF! Firefox is becoming the worst possible browser to use. I could have 1 tab open and I have like 4 instances of firefox running. Honestly, lately I've been using the ghetto browser I made a while back. It's not fancy at all. It displays web pages and that's it but, it uses practically no system resources. It displays some pages wrong cause it doesn't really support HTML5 and CSS3 but, I honestly don't care. I don't surf the web for "pretty" I surf the web for info. Everything could look like craigslist for all I care I just want to be able to read it.

A note that may be important. If you are running an app as an administrator you need to run your .bat as an administrator or it will just throw a bunch of errors claiming it can't shut down any of the processes. I ran into this issue recently cause I tend to run FlashDevelop as an administrator. I kept clicking my bat and it was just ERROR after ERROR. It dawned on me that I should open the bat as an admin and then killing processes worked. Also, I am now positive that an application has to be in your Environmental PATH to refer to it only by name unless the bat is in the same folder as the program you want to kill. Chrome is not in my Environmental PATH and when I choose "Kill Everything" it always throws an error at the end saying it is an "unrecognized program". I guarantee you if I added chrome to the PATH that message would go away. I never run chrome and don't really care about the little message.

It may or may not be obvious that "& cmd" is just my little way of getting the command prompt to appear so
1) the bat doesn't just run and disappear real quick ...and
2) just in case I want to type some other command

If you dont care about the command prompt and maybe just want to "press any key to exit" message to appear ~ substitute "& cmd" with PAUSE. If you actually want the bat to just run and disappear on it's own ~ substitute "& cmd" with EXIT. Personally, I like the bat to stick around so I can read the results and as long as it's sticking around I like it to still be useful (ie wait for more commands) but, there is no rule that says you have to do it that way. Actually you don't even have to write EXIT if your bat doesn't have choices in it. Just get rid of "& cmd" and it will disappear.

OneMadGypsyPostSeptember 26, 2018, 23:14
Moderator
Posts: 307
Registered:
November 12, 2017, 00:13
Hot topicReply To: Kill Everything

Here is one more little code that someone may find helpful

cd /d %~dp0

You don't have to understand this code and I don't intend to explain it's symbolic workings. Just know that if you put this at the top of a bat it is going to change the current working directory to whichever directory the bat is in. If I was going to give a symbolic explanation of the above I would say that it specifically says "change the directory to the complete absolute path of this file without the file name". It's up to you to figure out which part of all of that means what, if it is important to you.

so let's say you put that at the top of a bat that is in C:/Folder1/Folder2/theBat.bat ... and let's say you open a command prompt and type C:/Folder1/Folder2/theBat next to the prompt, it is automatically going to change the prompt from C:> to C:/Folder1/Folder2 >

This can be super helpful in a scenario where you want to call a bat remotely but the bat needs to work with files and directories from it's directory. If you call a bat remotely from the C: prompt that bat is going to try and do it's job from the C:/ directory. That is almost always the mistake people make. They call the right bat but they leave the current working directory something completely wrong. The above code eliminates that problem. Actually to be even more specific ANYTHING that remotely calls a bat is telling the bat to work from the directory of the thing that called it ~ unless you use this code.

You can bring it a step further, too. Since the above code literally means "THIS DIRECTORY" you can append sub-directories to it like so

cd /d %~dp0/mySubDirectory

I tend to dump the topmost code at the beginning of all of my bats. In bats that don't need it it won't matter and anything else is a bat that does need it.

OneMadGypsyPostSeptember 28, 2018, 20:44
Moderator
Posts: 307
Registered:
November 12, 2017, 00:13
Hot topicReply To: Kill Everything

Today is Friday and I tend to stop whatever I am doing and play with other languages and projects on Fridays. Today I decided to expand upon the ideas in this thread with a little .bat application

QuickTask ver 1.0

@ECHO off

ECHO #     QUICKTASK v1.00 ~ OneMadGypsy     #
ECHO # Run Simple Tasks Without The Bullshit #

:START
ECHO.
ECHO Please choose a selection:
ECHO 1. End Browser Tasks:
ECHO 2. Clean Temp Files:
ECHO 3. Backup Documents:
ECHO 4. Run All Above:
ECHO 5. Defrag Drive:
ECHO 6. Command Prompt:
ECHO 7. Close Application

SET /P choice=Choose an option number and press enter: 
if not "%choice%"=="" set choice=%choice:~0,1%
if "%choice%"=="1" GOTO PHASE1
if "%choice%"=="2" GOTO PHASE2
if "%choice%"=="3" GOTO PHASE3
if "%choice%"=="4" GOTO PHASE1
if "%choice%"=="5" GOTO PHASE5
if "%choice%"=="6" GOTO PHASE6
if "%choice%"=="7" EXIT
ECHO "%choice%" is not valid, try again
GOTO START

:PHASE1
ECHO.
ECHO # KILL MAJOR BROWSER INSTANCES #
ECHO.
Taskkill /T /F /IM firefox.exe /IM chrome.exe 
if "%choice%" == "4" GOTO PHASE2
GOTO START

:PHASE2
ECHO.
ECHO # REMOVING TEMPORARY GARBAGE #
ECHO.
rd /s %temp%
md %temp% 
rd /s C:WindowsPrefetch
if "%choice%" == "4" GOTO PHASE3
GOTO START

:PHASE3
ECHO.
ECHO # BACKUP DOCUMENTS FOLDER #
ECHO type "menu" to return to the menu
ECHO.
SET /P drive=Please enter the full path to your destination folder: 
IF "%drive%"=="" GOTO ERRORMSG
if "%drive%"=="menu" GOTO START
IF NOT EXIST %drive% GOTO NODIR
robocopy %USERPROFILE%Documents %drive% /e
GOTO START

:PHASE5
ECHO.
ECHO # DEFRAG DRIVE #
ECHO type "menu" to return to the menu
ECHO.
SET /P drive=Please enter the drive you wish to defrag: 
IF "%drive%"=="" GOTO ERRORMSG
if "%drive%"=="menu" GOTO START
IF NOT EXIST %drive% GOTO NODRIVE
defrag %drive%
GOTO START

:PHASE6
ECHO.
cmd

:ERRORMSG
ECHO.
ECHO The destination path cannot be empty, try again.
if "%choice%" == "3" GOTO PHASE3
if "%choice%" == "4" GOTO PHASE3
if "%choice%" == "5" GOTO PHASE5

:NODIR
ECHO.
ECHO The path "%drive%" does not exist, try again
GOTO PHASE3

:NODRIVE
ECHO.
ECHO %drive% does not exist, try again
GOTO PHASE5

It's pretty simple. You can kill firefox and chrome tasks (it's easy to add other browsers), clean up your temp/prefetch directories, backup your documents directory to a destination of your choice, all three of those in one go, and/or defrag a chosen drive.

For deleting your temp/prefetch data you are prompted per folder if you y|n really want to do it. If you choose to backup your documents or defrag by accident or change your mind before you enter a drive/path, you can just type "menu" to be brought back to the menu. After any process is complete it automatically brings you back to the menu, where you can choose more things, including the command prompt or to exit. For backing up the documents folder or defragging a drive the system tests whether the path you entered is legit and if it is not it says so and brings you back to the "enter a path/drive" prompt. Every section echoes a message about what it is about to do.

I'm pretty sure I didn't make any mistakes. I mean, I wrote all of this in like 15 minutes, tested all the options twice, including putting in wrong things to make sure errors work, and nothing seemed to be broken but, It's not like this has had any heavy testing. It does seem to give better results if you run it as an administrator (at least for me). If anything is broken or seems to be, tell me what happened and I could probably fix it in like 5 seconds. Nothing about this is mysterious or complicated. It just looks like a lot due to all the ECHO, GOTO and IF. If there was some way to get rid of all of that this would be like 10 lines of simple commands.

Downgraded286PostOctober 7, 2018, 21:33
Rookie
Posts: 19
Registered:
October 7, 2018, 05:26
Hot topicReply To: Kill Everything

Firefox, Chrome etc usually have multiple processes to make the browser more responsive in an age where even quad cores are standard, and up to 8 core, 16 thread chips exist on mainstream desktop systems (more with HEDT platforms). Opening lots of tabs at once will create more processes (and eat up lots of RAM).

Firefox, and especially Chrome, suck though, because they like to send "your data" back home so Google can know more about you. I prefer SRWare Iron, which is based off Chrome, but (supposedly) doesn't do this.

OneMadGypsyPostOctober 7, 2018, 21:52
Moderator
Posts: 307
Registered:
November 12, 2017, 00:13
Hot topicReply To: Kill Everything

I'm going to check that out (SRWare).

I am not impressed with any program that claims to be good but, makes no effort to determine the system resources and suppress itself accordingly. IN FLASH I can run a couple/few functions and figure out what kind of resources are at my disposal. I can use that information to make decisions about how or whether something is done. To say the 53rd version (or whatever they are on) of firefox can't/doesn't do this is fucking sad.

Have you ever decided to run ten miles on an empty stomach? Of course not, cause your body told you before you even got on your feet "I NEED FOOD". Why would ANY application act differently? Firefox, Chrome all just gobble up RAM with great assumptions and in my case they then crash. Wow, your stuff is so good ... it's so good it runs terribly and unreliably cause you can't write a fucking if statement.

if(CANT_FUCKING_DO_THIS)
{
remanageCurrentResources();
}

Downgraded286PostOctober 7, 2018, 21:59
Rookie
Posts: 19
Registered:
October 7, 2018, 05:26
Hot topicReply To: Kill Everything

Well, if you don't like Chrome for its resource use, you probably won't like SRWare Iron either. It's basically Chrome, just that (they claim) it isn't telling anybody what you're doing with your browser. This is SRWare with just 2 tabs open:

OneMadGypsyPostOctober 7, 2018, 22:35
Moderator
Posts: 307
Registered:
November 12, 2017, 00:13
Hot topicReply To: Kill Everything

Well, honestly, when I said I made a ghetto browser and that I use it. I really meant that, and it is literally called Ghetto Browser. It doesn't even have scrollbars. It is literally an address bar, a button and an html viewer ... that is 100% all.

Image

OneMadGypsyPostOctober 7, 2018, 22:51
Moderator
Posts: 307
Registered:
November 12, 2017, 00:13
Hot topicReply To: Kill Everything

Image

Downgraded286PostOctober 7, 2018, 22:59
Rookie
Posts: 19
Registered:
October 7, 2018, 05:26
Hot topicReply To: Kill Everything

Maybe you should release that, some people might like it.

OneMadGypsyPostOctober 7, 2018, 23:49
Moderator
Posts: 307
Registered:
November 12, 2017, 00:13
Hot topicReply To: Kill Everything

Sure, I can release it ... with a lot of disclaimers. It's not called Ghetto Browser because it is awesome. It's called Ghetto Browser cause it is Ghetto AF.

a) you HAVE to type http://
b) lots of css isn't going to work properly
c) lots of javascript isn't going to work properly
d) if there is some error it just wont do anything
e) it's highly possible it will just give up on loading images
f) there are no scrollbars or navigation buttons. You have to use your mousewheel to scroll. If the page needs to be scrolled horizontally ~ make the window wider (lol)
g) videos will not work ~ no youTube, vimeo or any other video
h) there are no tabs
i) there is no indication that anything is ever even working (LMAO)
j) coming to a site like this one (ie...thousands of lines of javascript) is gonna load REALLY slow
k) you can only load ONE instance of the browser. You could click the .exe 50 gabillionty times and you will still only have ONE instance.

features:
a) an address bar
b) a submit button
c) cntrl+LEFT or cntrl+RIGHT go BACK/FORWARD in history (respectively) or maybe it wont (lol)
d) pressing enter will load the address (!even if it is already loaded!). In other words, ENTER is "go" no matter what. You don't even have to have the caret in the address bar.
e) the address bar will refresh to tell you the page you are on when it is finished loading (usually)
f) there is no fullscreen BUT you can resize/maximize/minimize the window

I made this browser for one and only one reason ~ to be able to read webpages without any bullshit. I didn't care if it displayed properly. I didn't care about ANYTHING except being readable and knowing there is no tracking, tracing, excessive ram usage or anything else. My Ghetto Browser is perfect for navigating stuff like Google Groups and other such sites where the main focus is text.

Don't even bother telling me something don't work. I will never fix it, and I'm telling you right now all kinds of stuff works half way or not at all. It's quick dirty and simple. I will say this though. In all the years I have been using this it has never crashed. Even if something goes wrong and it hit some error that it never notified you of, simply typing in a new address (that isn't wrong) will load that address.

https://drive.google.com/open?id=1jwX8TGq_HzTy1Rv_hytS_vyIklsO7ewo

EDIT: I forgot, you can scroll using the arrow keys, too.

OneMadGypsyPostOctober 8, 2018, 00:41
Moderator
Posts: 307
Registered:
November 12, 2017, 00:13
Hot topicReply To: Kill Everything

Downgraded286PostOctober 8, 2018, 07:36
Rookie
Posts: 19
Registered:
October 7, 2018, 05:26
Hot topicReply To: Kill Everything

Well, at least the release notes were funny. Where are the smilies?

Pages: 1
Page loaded in: 0.067 seconds.