Batch Utility window bat script

Read line by line the contents of txt
@echo off
for /f %%i in (C:\Users\86132\Desktop\name.txt) do (
echo %%i>>name2.txt
echo %%i
)
pause
 
File folder traversal script
echo off
cd .. \ .. \ .. \ Dist \ media \ gui
FOR /F "delims==" %%i IN ('dir /b') do (
if exist "..\..\..\Tools\texturepack\%%i" (echo %%i ok ) else (echo %%i err)
)
pause
 
Traverse Folder, including sub-folders in the file name
echo off & color 0A
:: specify the starting folder
set DIR="C:\Users\86132\Desktop\html"
echo DIR =% DIR%
 
 
:: Parameter / R represents needs to traverse subfolders, represents not remove the traverse subfolders
:: %% f is a variable, like the iterator, but this variable only by a letter, to bring the front %%
:: brackets are wildcards, you can specify the suffix, *. * Means all files
for /R %DIR% %%f in (*.php) do (
echo %%f
)
pause
 
After the file monitoring script (including subdirectories), add in the detection of a new file, call readfile_line.bat, and then delete the newly added file, this script can be used as landing Trojans defense system as a window
@echo off & title monitored folder By Imada Qin Yao
color 0a & mode 35,3
:: set to monitor folders
set MtrDir=E:\phpStudy\WWW
:: Set bat script to call
set Bat=readfile_line.bat
echo is initializing the log file ...
(for /f "delims=" %%a in ('dir /a-d/s/b "%MtrDir%\*"') do (
    echo "%%~a"
))>"%tmp%\oFiles.Lst"
:Loop
set "Change="
cls & echo is monitoring folders ...
for /f "delims=" %%a in ('dir /a-d/s/b "%MtrDir%"') do (
    findstr /i "^\"%%~a\"$" "%tmp%\oFiles.Lst" >nul || (
        del /f /q "%%~a"
        set Change=1
    )
)
if defined Change (
    echo found new files, start other scripts.
    start "" "%Bat%"
)
goto Loop
 
Internet proxy settings
@echo off
echo began to set IE proxy access
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyEnable /t REG_DWORD /d 1 /f
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyServer /d " http=183.129.207.82:11169;https=183.129.207.82:11169" /f
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyOverride /t REG_SZ /d "<-loopback>" /f
echo 代理设置完成按任意键关闭
pause>nul
 
取消代理
@echo off
echo 开始清除IE代理设置
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyEnable /t REG_DWORD /d 0 /f
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyServer /d "" /f
reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyOverride /f
echo IE代理清楚完成按任意键关闭
pause>nul
 
删除某个文件夹某种后缀的所有文件
@echo off
del /a /f /s /q C:\Users\86132\Desktop\bingdu\*.sarut
 

Guess you like

Origin www.cnblogs.com/kunspace/p/12149813.html