Freedom wrote some batch processing _dos/bat

Source: Internet
Author: User
Tags goto
Process Management Batch miniaturized version (almost the earliest)
Copy Code code as follows:

@echo off
Title Process Management
Color 3F
echo Process Management Batch miniaturized version
Echo.
Echo Lxsea Freedom
Echo applies to simple operations that cannot be opened by Task Manager and normal virus judgments
Echo www.lxsea.com
Tasklist
Pause
Color B1
Echo Saves the data (the. csv file will be generated in this directory)
Echo.
echo If you have previously saved the data will be compared to the current and previous data, please note the comparison results
Echo.
Echo updates the process's files every time it is used
Echo.
Echo's second use will change the tasklist1 to Tasklist0, and the next time the tasklist0 will be deleted and the cycle
Pause
If exist tasklist0.csv del/q tasklist0.csv
If exist tasklist1.csv ren tasklist1.csv tasklist0.csv
Tasklist/fo:csv>tasklist1.csv
If exist Tasklist0.csv FC Tasklist1.csv Tasklist0.csv
echo stop process ends with PID
echo Process ID can look at the data in the table
Echo Stop is in danger, please choose carefully.
echo If you do not want to operate please close directly
Color FC
Set output=
set/p enter= please input PID:
Ntsd-c q-p%enter%
Echo Welcome to the ideal Technology forum www.lxsea.com
Pause
: End


This is a batch for comparing files (now looks naïve):
Copy Code code as follows:

@echo off
Color FC
Title Check DLL files and exe files under C:\WINDOWS\system32
Echo. -------------------------------------------------------------------------------
Echo. Check
Echo. DLL files and exe files under C:\WINDOWS\system32
Echo. Made by base pull freedom
Echo. Welcome to Wwww.lxsea.com.
Echo. -------------------------------------------------------------------------------
Echo. The first run will produce a 0.txt record exe and DLL file
Echo. The second time will produce 1.txt and automatically compare to 0.txt
Echo. Used to determine whether new files are generated
Echo. This is because System32 loves hiding spots for viruses.
If not exist 0.txt Goto begin
REM judge whether there are 0.txt
If exist 1.txt del 1.txt
REM judge whether there are 1.txt there is deleted
ren 0.txt 1.txt
REM Changes 0.txt to 1.txt
: Begin
Dir/b/a:c:\windows\system32\*.exe >0.txt & dir/b/a:c:\windows\system32\*.dll >>0.txt
REM above/A: is the meaning of displaying all files
Echo.
Echo.
Echo┌────────────────────────────────────┐
set/p= <nul
FOR/L%%i in (1 1) do set/p a= <nul&ping/n 1 127.0.0.1>nul
echo 100%%
Echo└────────────────────────────────────┘
IF ERRORLEVEL 1 echo Failed Maybe your system is not installed in the C disk
IF ERRORLEVEL 0 Echo was successfully created
If not exist 1.txt Goto end
set/p s= Press ENTER for file comparison
Cls
Color 8F
Echo. The variance appears (for example):
Echo. 0.txt---------File 0.txt
Echo. 1.TXT---------File 1.txt
Echo. 123.dll-------------file 0.txt is different from 1.txt
Echo. 12.exe--------------file 0.txt is different from 1.txt
Echo. ---------------except for 1.txt and 0.txt.
Echo. Description 0.txt and 1.txt different is 0.txt more 123.dll and 12.exe These two files this is to be noted!
set/p j= Press ENTER to start
FC 0.txt 1.txt
: End
set/p = Press ENTER to exit

Looking for files (this is casual play ...). In fact, use p to find a file not so annoying
Copy Code code as follows:

:: Code by Freedom @www. lxsea.com
:: Made in 2009_7_2
@echo off
Setlocal enabledelayedexpansion
Goto NEW
: Start
Set o=
Set j=
Set wen=
set/p cc=
: New
Echo.
echo helps you find files
Echo.
Echo 1. View a list of files (view only the current directory)
Echo.
Echo 2. Open file (current directory and internal)
set/p j= Please enter the letter ordinal (press ENTER to exit directly):
If%j% equ 1 goto:fin
If%j% NEQ 2 echo serial error &cls&goto:start
: Wen
for/f "delims="%%a in (' dir/b/s ') do echo%%a >>1.txt
set/p wen= What's the file you're looking for?
for/f "eol=-"%%i in (' Find '%wen% ' 1.txt ') to do echo file location:%%i&start%%i
set/p o= continue to find Files (y/n):
if/i%o%== "Y" Goto:wen
Del 1.txt/q
Cls
Goto Start
: Fin
Cls
DIR/A:
set/p o= whether to find Files (y/n):
if/i%o%==y Goto:wen Else Goto:fin
Cls
if/i%o%==n Goto:start
Pause


This is the most recently written prohibit the program to run with the Ws2_32.dll method Ifeo lazy to write ...
Copy Code code as follows:

:: Madeby Freedom Batch Processing house 20090812
@echo off&setlocal enabledelayedexpansion
Title use Ws2_32.dll to block file run batch Home
Echo.
Echo uses Ws2_32.dll blocker to run
Echo.
The Echo program is not perfect, just tired of Ifeo.
Echo.
ECHO is not valid for green programs or for not calling this DLL
Echo.
: New
echo 1. Disabling programs
echo 2. View disabled list
Echo 3. Remove Disable Program
Set cho=
set/p cho= Input 1~3:
If%cho% equ 1 goto MDD
If%cho% equ 2 goto viewd
If%cho% equ 3 goto Deld
Echo, you're not typing.
Goto NEW
: QS
Echo's got it, and you're kidding me. Change the address.
: MDD
Set place=
: Check
set/p place= the directory address (such as D:\exe) where the input file is located:
If exist C:\bad find "%place%" C:\bad.txt>nul &&goto QS
If not exist "%place%" goto check
MD "%place%" \WS2_32.DLL\FR. \
Echo%place%>>c:\bad.txt
Echo's established, ~~~~~~.
Pause>nul
Cls
Goto NEW
: Bads
Echo does not have this program hey, look at the table.
Pause>nul
: viewd
If not exist "C:\bad.txt" Goto WRO
Type C:\bad.txt
Pause>nul
Cls
Goto NEW
: Wro
echo you have not run this program or the document has been lost sorry AH ~ ~
Pause>nul
Cls
Goto NEW
:d Eld
Set kill=
set/p kill= Enter the path of the program you want to delete:
Find "%kill%" C:\bad.txt>nul | | Goto Bads
Rd "%kill%\ws2_32.dll"/s/q
Echo. >tem.txt
@for/F "tokens=* delims="%%i in (' findstr/i/v/c:%kill% c:\bad.txt ') does (
Set var=%%i
Echo!var!>>tem.txt
)
Copy tem.txt C:\bad.txt >nul
Echo's done.
Pause>nul
Cls
Goto NEW

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.