Get the App
SLTechnology News&Howtos  ›  Development  › 

How to kill the process and delete the batch bat code of the source file

Shulou Source: shulou.com Published: 2022-06-03 08:27:48 11月15日 Update

Editor to share with you how to kill the process and delete the source file batch bat code, I believe that most people do not know much, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!

After double-clicking to run, enter the process name

Batch code:

The code is as follows:

@ echo off color 6e del 1.txt del ildd.txt TASKLIST > > ildd.txt title kills the process and deletes the source file-by:qp cls echo. Echo current process: for / f "skip=3"% I in ('findstr. * "ildd.txt"') do echo% I echo. Please enter the name of the process to be terminated and deleted. For example, echo: 1.exe ping.exe rar.exe set / p command= enter: wmic process get ExecutablePath,Handle | find / I "% command%" > > 1.txt cls for / l% d in (1 14) do echo. Echo the process you entered is:% command% for / f "tokens=1 delims=."%% I in ('type 1.txt') do (the path found by echo is:% i.exe & set "path =% I") echo. Echo presses any key to end the process and deletes the file pause > nul echo. Echo is determined to delete, please press any key. For / l% d in (1 14) do echo. Pause > nul taskkill / f / im% command% del / f "% path% .exe" if not exist "% path% .exe" echo successful: file deleted... Del 1.txt del ildd.txt echo press any key to end the program pause > nul above is "how to kill the process and delete the source file batch bat code" all the contents of this article, thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Tags: Process code path input source file article content file success not much name most more knowledge program industry information information channel channel reference Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno macOS MySQL Microsoft Apple Linux