Post Reply Post your batch scripts
Creator
12221 cr points
Send Message: Send PM GB Post
M / Canada
Offline
Posted 9/8/16 , edited 10/20/16
Show off your scripts



i'm interested in seeing what you guys can write.
just copy and paste a batch script with a small description of what it can do :D

( And if possible, tell us how you came to learn Batch and also what program you use to write your scripts )

I'll start




@Echo Off
setlocal enabledelayedexpansion
set c=0
FOR /F "delims=" %%i IN ('tasklist /fo list') DO (
  set /a c+=1
  set taskLine[!c!]=%%i
)
cls
set currentParseLine=1
:Loop
set listLengthCheck=!c!
set /a listLength=%listLengthCheck%/5-2
set process1=taskline[%currentParseLine%]
set process2=!%process1%!
set toExtract=%process2%
set /a currentParseLine+=5
set currImageName=%toExtract:Image Name:   =%
echo %currImageName%
ping loopback -n 1 >nul
::

TaskKill /im "%currImageName%" /f

::
:skipKill
IF %currentParseLine% GTR %listLengthCheck% (goto :eof) Else (goto Loop)



Written with Visual Studio Code


My script simply kills all running tasks (except those who are protected like "System" )
I wrote it just for fun and i also don't recommend that you try and run it (at least not on Your computer)
You must be logged in to post.