3 Simple Ways to
Share What You Make

With Instructables you can share what you make with the world — and tap into an ever-growing community of creative experts.

PhotosPhotos

Share one or more photos of a project, recipe, or whatever you've made, quickly and easily.

Step by StepStep-By-Step

Share your step-by-step photos with text instructions of what you made so others can do it too!

VideoVideo

Share your how-to video. You'll need your embed code from a video site such as YouTube.

Process sniper - batch file

Process sniper - batch file
This is a small program I have been working on.  I have been working on it for a few hours in total so it still might have some bugs, but anyway.
The batch file contains two functions, 1.) it will list all the processes that are running on your computer and 2.) it can kill the process that you type in by either name (process.processextension e.g notepad.exe) or PID.  It also outputs all the process names you type in to an external file that is written over when you start the batch file again, the name of this file is configurable in the code under the variables at the top of the code.  It could easily save it anywhere on your hard drive with only very minor tweaks to the code.
here is the code:

:: This is origional code writen by John Allen
:: Permission to use this code without payment is given to anyone as long as credit is given
:: on the following conditions:
:: 1.) If this code is used as part of a program intended for comercial use, the writer (John Allen)
:: must be contacted and notified of this and he reserves the write to deny the useage of the code to anyone
:: 2.) This message and the title block is left in the code
@ECHO OFF
set version=1.6
set outputfile=log
set outfileext=txt
color 0a
title Process Sniper v%version%
echo Processes attempted to shut down in the last session:>%outputfile%.%outfileext%
echo :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
echo ::    Process Sniper v%version%        ::
echo ::          writen by John Allen        ::
echo :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
echo.
goto choice
exit /b
:list
wmic process get Name, ProcessID
goto choice
:kill
set /p input=Enter the process name/PID you wish to snipe:
taskkill /pid %input%
echo %input%>>%outputfile%.txt
goto choice
:close
cls
color 0c
echo :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
echo ::    You have been using        ::
echo ::    Process Sniper v%version%        ::
echo ::           writen by John Allen        ::
echo ::         Press any key to close...        ::
echo :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
pause>null
DEL null
exit
:choice
echo Choose from the following:
echo 1.) List processes currently running
echo 2.) Snipe a process by name/PID
echo 3.) Exit Process Sniper v%version%
choice /c 123 /n
if errorlevel 1 set gt=list
if errorlevel 2 set gt=kill
if errorlevel 3 set gt=close:
goto %gt%








 
Remove these adsRemove these ads by Signing Up
 

Step 1Outro

Outro
Any help on improving it would be much appreciated, this is my first batch application and I am looking into doing more in the future, maybe some small games or some more complex processes to do with administation on servers or something, but what ever.
« Previous StepDownload PDFView All StepsNext Step »

Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!
1
Followers
1
Author:Jallen1337