标题: [代码合集] 感谢批处理之家,发下我自己大部分源码 [打印本页]
作者: yunyan100 时间: 2018-11-2 22:27 标题: 感谢批处理之家,发下我自己大部分源码
- @echo off&Mode con cols=72 lines=23&color e&cd /d %~dp0&set batname=批处理单文件制装及其他功能
- ::tool(1以外no)查tool权限,short(1以外no)开始菜单快捷,right启动权限(0非1要),au3启动框窗宽度,cho延时秒,fbb选择框默认,:bp为保存,:dp为临时位置
- set dp=%temp%\Amay&set "bpq=D:\AppSave"&set "fbb=D:\AppSoft"&set /a au3=100&set cho=30&set tool=1&set short=1&set right=1
- if "%short%" equ "1" %~dp0Todo\shortcut.exe /f:"%AppData%\Microsoft\Windows\Start Menu\Programs\MayTools.lnk" /a:c /t:"%~dp0MayTools.bat"
- set "bp=%bpq%"&rd /s/q %dp%&md %dp%&md %dp%\file&md %dp%\st&set "fb=%fbb%"&cls&if "%right%" equ "0" call :soft
- %1 %2
- cls&ver|find "5.">nul&&call :soft||mshta vbscript:createobject("shell.application").shellexecute("%~s0","call :soft","","runas",1)(window.close)&goto :eof
- :soft
- title %batname% by Lovemay ^>^> yunyan100
- (if not exist C:\Setting set "fb=%fbb%"&set "bp=%bpq%"&set "dik=no"&call :sett) >nul 2>nul
- set bp=<nul&set fb=<nul&for /f "tokens=1-2 delims==" %%a in (C:\Setting) do (if "%%a"=="Save" set "bp=%%b"
- if "%%a"=="Soft" set "fb=%%b"
- if "%%a"=="Auto" set "dik=%%b") >nul 2>nul
- call :sett&if not exist %fb% md %fb%&if not exist %bp% md %bp%
- cls&(setlocal disabledelayedexpansion&md %dp%&md %dp%\file&md %dp%\st) >nul 2>nul
- for %%a in (start pa bit runexe64 src dst str batnsi paa pax pay pat pan biy fve ave png ss) do set %%a=<nul
- echo.&echo ★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★
- echo ☆ ☆
- echo ★ %batname% ★
- echo ☆ ☆
- echo ★ W.一条龙打包.Exe 1.MayTools多功能 ★
- echo ☆ E.重置后打包.Exe 2.Window系统工具 ☆
- echo ★ G.NSIS 打包.Exe 3.Reg转为Bat/Nsi ★
- echo ☆ R.7-Zip 打包.Exe 4.提取ExeIco图标 ☆
- echo ★ F.WinRar打包.Exe 5.文件信息表.Exe ★
- echo ☆ T.设置权限为.Exe 6.批量压缩文件夹 ☆
- echo ★ D.多程序打包.Exe 7.文件命名及归档 ★
- echo ☆ A.配置文件之处理 8.批量建空值文件 ☆
- echo ★ S.文件及其他处理 9.Chm 文件反编译 ★
- echo ☆ Q.文件及其他查看 0.清理系统(隐形) ☆
- echo ★ ★
- echo ☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆
- if not "%ercr%"=="" (echo. %ercr%)else (echo. 今天:%date:~0,4%年%date:~5,2%月%date:~8,2%日 时间:%time:~0,5% 星期:%date:~-1,1%)
- echo ________________________________________________________________________
- choice /c 1234567890wegrftdasqz /n /m "请选择菜单序号:" /t 6 /d z
- if %errorlevel%==21 ( set ercr=<nul&goto :soft)else ( set ercr=<nul&set start=%errorlevel%)
- if /i "%start%"=="11" ( call :ofile
- )else (if /i "%start%"=="12" ( call :patty&set fve=:soft&call :bty
- )else (if /i "%start%"=="13" ( call :patty&call :nsis
- )else (if /i "%start%"=="14" ( call :patty&call :7zinf
- )else (if /i "%start%"=="15" ( call :patty&call :winrar
- )else (if /i "%start%"=="16" ( call :patty&call :de :soft&call :soft
- )else (if /i "%start%"=="17" ( call :patty&set ave=:soft&call :exeau3
- )else (if /i "%start%"=="18" ( call :patty&call :exetxt
- )else (if /i "%start%"=="19" ( call :fold
- )else (if /i "%start%"=="20" ( call :ffname
- )else (if /i "%start%"=="1" ( call :back
- )else (if /i "%start%"=="2" ( call :bbs
- )else (if /i "%start%"=="3" ( call :vbr
- )else (if /i "%start%"=="4" ( call :exeico
- )else (if /i "%start%"=="5" ( start %~dp0info.exe&goto :soft
- )else (if /i "%start%"=="6" ( call :yasuo
- )else (if /i "%start%"=="7" ( call :cfile
- )else (if /i "%start%"=="8" ( call :onlysoft
- )else (if /i "%start%"=="9" ( call :bchm
- )else (if /i "%start%"=="10" ( call :cleaner))))))))))))))))))))
-
- :ofile
- ::原文件(夹)路径设置,bty单独32位或64位,或分32位和64位,:exeau3运行多程序
- rd /s/q %dp%\file\temp&del /f/s/q/a %dp%\file\temp&md %dp%\file\temp\&del /f/s/q/a %dp%\st&set fve=:ofile&set ppa=AppData&cls
- call :callnn 选择文件(夹) :soft 0 a n exe\bat 77 88
- dir/ad "%pa%" >nul 2>nul&&set patt=%pa%&&set payy=%pa%||xcopy /y "%pa%" "%dp%\file\temp" >nul 2>nul&&set patt=%dp%\file\temp
- :bty
- if exist "%patt%\To%name%.exe" del /f/q/s/a "%patt%\To%name%.exe"
- call :callnn 运行程序配置 %fve% 2 1 n n 77 88 仅32或64位.Exe 含32和64位.Exe 多程序打包.Exe
- if "%pa%" equ "3" (set ave=:bty&call :exeau3)else (if "%pa%" equ "1" (set bit=%pa%&set tname=启动运行程序)else (set bit=%pa%&set tname=32位运行程序))
- if /i "%start%"=="12" (for /f "delims=" %%a in ('dir /b /a-d /s %payy%\*.exe %payy%\*.bat') do set "patt=%%~dpa"&goto :btyy) 2>nul
- :btyy
- if "%patt:~-1%" equ "\" set "patt=%patt:~,-1%"
- call :callnn %tname% :bty 1 1 n exe\bat 77 88
- call :ltty
- set runexe=%pa%&set pao=%pax%&set name=%pax%&if exist %dp%\st\exfile.au3 del /f/s/q/a %dp%\st\exfile.au3
- if /i "%bit%" equ "1" goto :fileiic
- call :callnn 64位运行程序 :bty 1 1 n exe\bat 77 88
- call :ltty
- set runexe64=%pa%&goto :fileiic
- :exeau3
- set /a num=0&call :callnn 多程序打包.Exe %ave% 2 1 n n 77 88 有.au3重置程序 无.au3制作程序 设置默认改宽度
- if "%pa%" equ "1" (if exist %dp%\st\exfile.au3 (call %~dp0au3\aut2exe.exe /in "%dp%\st\exfile.au3" /out "%patt%\Do%pao%.exe" /nopack /icon "%dp%\st\0.ico" /comp 4&&goto :soft)else (set "ercr=无exfile,未生成"&goto :soft))else (if "%pa%" equ "2" (set pa=<nul&set au55=<nul&goto :au3)else (set au3=<nul&set /p au3="请设置宽度,当前%au3%:"&set pa=<nul&goto :au3))
- :au3m
- if /i "%start%" neq "11" (set "ercr=多Exe制作成功"&call :info&goto :soft)else (goto :fileiic)
-
- :fileiic
- ::获取版本信息,程序权限配置
- call :callnn 获取版本信息 :btyy 1 1 n exe\bat 77 88
- call %~dp0info.exe "%pa%" "%dp%\st\0.ico" 3
- call %~dp0info.exe "%pa%" "%dp%\st\info.ini" 1
- if not exist "%dp%\st\0.ico" copy "%~dp0Todo\0.ico" "%dp%\st\0.ico" >nul 2>nul
- :exeiif
- call :info&&call :de :fileiic
-
- :package
- ::下面为封装方式选择
- call :callnn 选择打包.Exe :exeiif 2 1 n n 77 88 选择NSIS打包.Exe 选择7-Zip打包.Exe 选择WinRar打包.Exe
- if /i "%pa%" equ "1" (call :nsis)else (if /i "%pa%" equ "2" ( call :7zinf)else ( call :winrar))
- :nsis
- if exist "%patt%\To%name%.exe" del /f/q/s/a "%patt%\To%name%.exe"
- cls&echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo. 正在制作中......
- call mshta vbscript:createobject("wscript.shell").run("%~dp0Todo\nsis\makensis.exe /v2 %dp%\st\Nsis.nsi",0)(window.close)
- set "ercr=NSIS制作成功"&goto :soft
- :7zinf
- if not exist "%patt%\To%name%.exe" copy /y %dp%\st\To%pao% "%patt%\To%name%.exe"
- call %~dp0info.exe "%dp%\st\0.ico" "%~dp0Todo\7z\7x86.sfx" "%dp%\file\tmp"
- cls&echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo. 正在制作中......
- call %~dp0Todo\7z\7z.exe a -mx=9 -m0=LZMA2 -mf=BCJ2 "%dp%\file\tmp.7z" "%patt%\*" >nul 2>nul
- call copy /b "%dp%\file\tmp" + %dp%\st\ini.txt + "%dp%\file\tmp.7z" "%bp%\%name%.exe"
- cls&echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo. 正在制作中......
- call %~dp0info.exe "%bp%\%name%.exe" "%dp%\st\info.ini" 2
- del /f/s/q/a "%dp%\file\tmp.*"&set "ercr=7zip制作成功"&goto :soft
- :winrar
- if not exist "%patt%\To%name%.exe" copy /y %dp%\st\To%pao% "%patt%\To%name%.exe"
- if exist "%bp%\%name%.exe" del /f/s/q/a "%bp%\%name%.exe"
- cls&echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo. 正在制作中......
- call %~dp0Todo\Rar\Winr.exe a -m5 -s -r -ibck -sfx -o+ -z%dp%\st\win.txt %winadmin% -iicon%dp%\st\0.ico "%bp%\%name%.exe" -ep1 "%patt%\"
- call %~dp0info.exe "%bp%\%name%.exe" "%dp%\st\info.ini" 2
- set "ercr=Win制作成功"&goto :soft
-
- :de
- ::对启动程序权限配置
- call :callnn 设置权限为.Exe %1 2 2 n n 77 88 清除管理员权限 添加管理员权限
- (if "%pa%" equ "1" (if exist "%dp%\st\exfile.au3" findstr /v "#RequireAdmin" "%dp%\st\exfile.au3">%dp%\st\#&&move %dp%\st\# %dp%\st\exfile.au3&&start %~dp0au3\aut2exe.exe /in "%dp%\st\exfile.au3" /out "%patt%\Do%pao%.exe" /nopack /icon "%dp%\st\0.ico" /comp 4
- findstr /v "RequestExecutionLevel user" "%dp%\st\Nsis.nsi">%dp%\st\#&echo RequestExecutionLevel user >%dp%\st\Nsis.nsi&&type %dp%\st\# >>%dp%\st\Nsis.nsi&findstr /v "MiscFlags" "%dp%\st\ini.txt">%dp%\st\#&&move %dp%\st\# %dp%\st\ini.txt&set winadmin=<nul)else (if exist "%dp%\st\exfile.au3" findstr /v "#RequireAdmin" "%dp%\st\exfile.au3">%dp%\st\#&&echo #RequireAdmin>%dp%\st\exfile.au3&&type %dp%\st\# >>%dp%\st\exfile.au3&&start %~dp0au3\aut2exe.exe /in "%dp%\st\exfile.au3" /out "%patt%\Do%pao%.exe" /nopack /icon "%dp%\st\0.ico" /comp 4
- findstr /v "RequestExecutionLevel user" "%dp%\st\Nsis.nsi">%dp%\st\#&move %dp%\st\# %dp%\st\Nsis.nsi&set "winadmin=-iadm"&findstr /v "UTF-8" "%dp%\st\ini.txt">%dp%\st\#&echo ;!@Install@!UTF-8!>"%dp%\st\ini.txt"&&echo MiscFlags="4">>"%dp%\st\ini.txt"&type %dp%\st\#>>%dp%\st\ini.txt))&del /f/s/q/a %dp%\st\#&if "%pa%" equ "1" (set "ercr=清除权限成功"&goto :eof)else (set "ercr=添加权限成功"&goto :eof)
-
- :exetxt
- ::一些需要调用的配置文件
- call :callnn 配置文件之处理 :soft 2 0 n n 77 88 文件Nisi 文件7zSFX 文件WinRar 文件Exfile 文件ToRun 文件info EXE释放位置
- (if /i "%pa%"=="1" ( start %~dp0nopad.exe %dp%\st\Nsis.nsi)else (if /i "%pa%"=="2" (start %~dp0nopad.exe %dp%\st\ini.txt)else (if /i "%pa%"=="3" (start %~dp0nopad.exe %dp%\st\win.txt)else (if /i "%pa%"=="4" (start %~dp0nopad.exe %dp%\st\exfile.au3)else (if /i "%pa%"=="5" (call %~dp0nopad.exe %dp%\st\ToRun.nsi&del /f/s/q/a "%patt%\To%name%.exe"&call %~dp0Todo\nsis\makensis.exe /v2 "%dp%\st\ToRun.nsi")else (if /i "%pa%"=="6" (call %~dp0nopad.exe %dp%\st\info.ini&call :info)else (goto :fiv)))))))&goto :soft
- :fiv
- call :callnn EXE释放位置 :exetxt 2 0 n n 77 88 释放到Windir 释放到Program 释放到AppData 释放到Temp
- (if "%pa%"=="1" (set ppa=Windir&call :info&call :de :fiv)else (if "%pa%"=="2" (set ppa=ProgramFiles&call :info&call :de :fiv)else (if "%pa%"=="3" (set ppa=AppData&call :info&call :de :fiv)else (set ppa=Temp&call :info&call :de :fiv))))&goto :exetxt
-
- :ffname
- ::查看文件夹
- call :callnn 文件及其他查看 :soft 2 0 n n 77 88 打开Soft 打开Save 打开Temp 清空内容 本人专用1 本人专用2 本人专用3
- (if /i "%pa%"=="1" (start "" "%fb%")else (if /i "%pa%"=="2" (start "" "%bp%")else (if /i "%pa%"=="3" (start "" "%dp%\st")else (if /i "%pa%"=="4" (set patt=<nul&set pa=<nul)else (if /i "%pa%"=="5" (if "%tool%" equ "1" (start %~dp0nopad.exe %~dp0MayTools.bat)else (set "ercr=无权限查看"))else (if /i "%pa%"=="6" (if "%tool%" equ "1" (start %~dp0nopad.exe "C:\Setting")else (set "ercr=无权限查看"))else (if "%tool%" equ "1" (start "" "%~dp0")else (set "ercr=无权限查看"))))))))&goto :soft
-
- :fold
- ::处理原文件路径
- echo On Error Resume Next>%dp%\1.vbs
- echo WSH.echo CreateObject("Shell.Application").BrowseForFolder(0,"请选择文件夹",256,0).Self.Path>>%dp%\1.vbs
- call :callnn 文件及其他处理 :soft 2 0 n n 77 88 Soft修改 Save修改 全部还原 Soft动态 Soft固定 Soft切换 删除文件
- (if "%pa%" equ "1" ((echo.&echo 调用文件夹:%fb%&for /f "delims=" %%i in ('cscript //nologo %dp%\1.vbs') do set "fb=%%i")&call :sett)else (if "%pa%" equ "2" ((echo.&echo 保存文件夹:%bp%&for /f "delims=" %%i in ('cscript //nologo %dp%\1.vbs') do set bp=%%i)&call :sett)else (if "%pa%" equ "3" (set "fb=%fbb%"&md %fb% >nul 2>nul&set "bp=%bpq%"&md %bp% >nul 2>nul&set "dik=no"&call :sett)else (if "%pa%" equ "4" (set "dik=ok"&call :sett)else (if "%pa%" equ "5" (set "dik=no"&call :sett)else (if "%pa%" equ "6" (goto :foldd)else (set patt=<nul&set pa=<nul&goto :delyy)))))))&goto :fold
- :foldd
- call :callnn 文件路径修改 :fold 4 0 n n 77 88
- (dir/ad "%pa%" >nul 2>nul&&set "patt=%pa%"&&set "payy=%pa%"||del /f/s/q/a %dp%\file\temp&&xcopy /y "%pa%" "%dp%\file\temp" >nul 2>nul&&set payy=%dp%\file\temp)&call :fold
-
- :delyy
- call :callnn 清除成内容 :fold 2 1 n n 77 88 全部删除 选择删除
- if "%pa%"=="2" call :callnn 清除成内容 :delyy 3 0 n n 77 88
- if "%pa%"=="1" (set "clea=for /f "delims=" %%a in (%dp%\Dell.txt) do echo;%%a")else (set clea=echo;"%pa%")
- cls&echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo. 正在删除中......
- %clea%|mshta "javascript:new ActiveXObject('Shell.Application').NameSpace(10).MoveHere(new ActiveXObject('Scripting.FileSystemObject').GetStandardStream(0).readline().split('"')[1]);close()"
- (if "%pa%"=="1" (del /f/s/q/a %dp%\Dell.txt)else ( findstr /v /c:"\"%pa%\"" %dp%\Dell.txt>%dp%\#&move %dp%\# %dp%\Dell.txt))&goto :soft
-
- :callnn
- ::此处为公共调用,%1标题名,%2上级名,%3(0路径设置,1文件表,2菜单表,3删除表),%4(a调用文件,b手动文件,n选择框,m输入框,1-90znm),%5(n不,1检查数字,f检查文件夹),%6(n文件夹,exe\bat),%7,%8临时输入名称,%9-%17临时菜单名,call :callnn 复制封装文件 :soft 0123 ab1-9nm n1f nexe 77 88 9个多量,(set png=1也有这个)
- set aa=%1&set bb=%2&set cc=%3&set dd=%4&set ee=%5&set ff=%6&set gg=%7&set hh=%8&set ii=%9
- shift /0&shift /1&shift /2&shift /3&shift /4
- set jj=%5&set kk=%6&set ll=%7&set mm=%8&set nn=%9
- shift /5&shift /6&shift /7
- set oo=%7&set pp=%8&set qq=%9
- for /f "delims=\ tokens=1-3" %%a in ("%ff%") do (set ff=%%a&if "%%b" neq "" set ff=%%a %%b&if "%%c" neq "" set ff=%%a %%b %%c)
- set "dff=*.%ff: =|*.%"&set "aff=*.%ff: = *.%"
- set fd=%fb%\&set pat=%patt%&set err=<nul&call :list&setlocal disabledelayedexpansion&goto :eof
- :list
- if exist %dp%\st\exe.txt del /s/q %dp%\st\exe.txt
- cls&echo.&echo. %batname% - %aa%
- if /i "%cc%" neq "0" goto :listy
- echo.&echo. %err%
- if /i "%hh%" neq "88" (set hh=%hh%) else (set hh=请拖入文件\夹路径)
- dir/ad "%fb%" >nul 2>nul||set "fd=%fbb%\"
- if /i "%dd%" equ "a" (dir/ad "%fd%" >nul 2>nul&&(for /f "delims=" %%a in ('%~dp0Release\expl.exe "%fd:~,-1%" "%dff%"') do set pa=%%a)||(for /f "delims=" %%a in ('%~dp0Release\expl.exe "%fd:~,-2%" "%dff%"') do set "pa=%%a"))else (if /i "%dd%" equ "b" (set pa=<nul&set /p "pa=%hh%(0主菜单,z上级):")else (set pa=<nul))
- set "pve=%pa%"&if not exist "%pa%" set "ercr=无选择或空值"&goto %bb%
- if /i "%pa%" equ "0" (goto :soft)else (if /i "%pa%" equ "z" (call %bb%)else (set "pa=%pa:"=%"))
- dir/ad "%pa%" >nul 2>nul&&set "pac=%pa%"&&set bv=0||for /f "delims=" %%a in ("%pa%")do set "pac=%%~dpa"&set bv=1
- cd /d "%pac%" &if %bv%==0 cd.. >nul 2>nul
- if "%dik%"=="ok" set "fb=%cd%"&call :sett
- if /i "%ff%" equ "n" (set ff=n)else ((pushd "%pa%"&dir/s/b/a-d %aff%) >nul 2>nul||set pa=<nul&&set err=无"%dff%"文件&&goto :list)
- cd /d "%pa%" >nul 2>nul&dir/ad "%pa%" >nul 2>nul&&(pushd "%pa%"&for /f "delims=" %%a in ('dir /b /a-d /s %aff%') do set "pa=%%~dpa"&goto :uac) >nul 2>nul||(set "ss=1"&for /f "delims=" %%a in ("%pa%") do set "pa=%%~dpa"&set "paa=%%~nxa"&goto :uac) >nul 2>nul
- :uac
- if "%pa:~-1%" equ "\" set "pa=%pa:~,-1%"
- for %%a in ("%cd%") do echo %%a>>%dp%\1.txt
- dir/ad "%cd%\" >nul 2>nul&&cd..&&goto :uac
- for /f "delims=" %%a in (%dp%\1.txt) do (setlocal enabledelayedexpansion&for %%i in (%%a) do (set "pay=%%~nxi"
- set "pay=!pay:(=!"
- set "pay=!pay:)=!"
- ren %%i "!pay!" >nul 2>nul))&endlocal&del /f/s/q/a %dp%\1.txt >nul 2>nul
- set "pa=%pa:(=%"
- set "pa=%pa:)=%"
- if "%ss%"=="1" set "pa=%pa%\%paa%"
- if "%ss%"=="1" set "paa=%paa:(=%"
- if "%ss%"=="1" set "paa=%paa:)=%"
- if "%ss%"=="1" ren "%pa%" "%paa%"
- if "%ss%"=="1" set "pa=%pa:(=%"
- if "%ss%"=="1" set "pa=%pa:)=%"
- if /i "%ee%" equ "f" (dir/ad %pa% >nul 2>nul||set pa=<nul&&set "err=不是文件夹"&&goto :list)else (if "%ee%" equ "1" (echo %pa%|findstr /be "[0-9]*">nul 2>nul&&goto :eof||set err="不是数字"&goto :list)else (set ee=n))
- if "%png%"=="1" goto :eof
- for /f "delims=" %%a in (%dp%\Dell.txt) do (if /i "%pve%"==%%a goto :eof)
- echo "%pve%">>%dp%\Dell.txt&cls&goto :eof
-
- :listy
- ::列出选择项目
- set "pan=%pat:(=%"
- set "pan=%pan:)=%"
- (for %%a in ("%pan%") do set "paa=%%~nxa")2>nul
- ren "%pat%" "%paa%" 2>nul
- set "pat=%pan%"&setlocal enabledelayedexpansion&set n=0
- if /i "%cc%" equ "1" ((pushd "%pat%"&for /f "delims=" %%a in ('dir/b/a-d !aff!') do (set /a n%%=99,n=n+1&set nb=!n!&echo !n!^|%pat%\%%a>>%dp%\st\exe.txt&echo. !n!.%%~nxa&if !n!==20 echo. 按任意键进入下列表&pause>nul)& popd) 2>nul
- (for /f "tokens=*" %%a in ('dir/b/ad "%pat%\*"') do (set /a n=n+1&set nb=!n!&echo !n!^|%pat%\%%a>>%dp%\st\exe.txt&echo. !n!.%%~nxa&if !n!==20 echo. 按任意键进入下列菜单&pause>nul))2>nul
- if "!nb!" lss "1" set pat=%patt%&set err="没有支持文件"&goto :list
- )else (if /i "%cc%" equ "2" (for %%a in (%ii% %jj% %kk% %ll% %mm% %nn% %oo% %pp% %qq%) do (set /a n%%=99,n=n+1&set nb=!n!&echo !n!^|%%a>>%dp%\st\exe.txt&echo. !n!.%%~nxa))else ((for /f "delims=" %%a in (%dp%\Dell.txt) do (set /a n%%=99,n=n+1&set nb=!n!&echo !n!^|%%a>>%dp%\st\exe.txt&echo. !n!.%%~nxa)) 2>nul))
- :choices
- if not "%err%"=="" echo.&echo. %err%
- echo.&if /i "%cc%" equ "4" echo 当前路径是:%patt%&echo.
- set "fd=%patt%\"&choice /c 1234567890znm /n /m "请选择(0主菜单,Z返回,N选择框,M输入框)%cho%秒后自动:%dd%" /t %cho% /d %dd%&echo.
- if %errorlevel%==10 (set ercr=<nul&goto :soft)else (if %errorlevel%==11 (call %bb%)else (if %errorlevel%==12 (if "%cc%" neq "1" (endlocal&set pa=<nul&set err="不支持选择框"&goto :list)else ((for /f "delims=" %%a in ('%~dp0Release\expl.exe "%fd:~,-1%" "%dff%"') do endlocal&set pa=%%a&goto :eof)||endlocal&set pa=<nul&set err="没有选择路径"&&goto :list))else (if %errorlevel%==13 (set pa=<nul&set /p pa=请输入序号^(0主菜单,Z上级^):)else (set pa=%errorlevel%))))
- if /i "%pa%" equ "z" (call %bb%)else (if /i "%pa%" equ "0" (set ercr=<nul&goto :soft)else (if "%cc%" gtr "0" (findstr /b "%pa%" "%dp%\st\exe.txt"&&goto :chkk||endlocal&set pa=<nul&set err="非正常选择"&goto :list)else (goto :chkk)))
- :chkk
- if "%cc%" equ "2" (endlocal&set "pa=%pa%"&goto :eof)else (for /f "tokens=1-2 delims=|" %%a in ('findstr /b "%pa%|" %dp%\st\exe.txt') do endlocal&set "pa=%%b")
- if /i "%cc%" equ "1" dir/ad "%pa%" >nul 2>nul&&endlocal&&set pat=%pa%&&set err=<nul&&set nb=<nul&&goto :list
- set "pa=%pa:"=%"
- endlocal&set "pa=%pa%"&goto :eof
-
- ::下面为一些公共调用功能,patty判断变量patt值是否存在,ltty文件路径配置,sett为可路径
- :sett
- if not exist "%bp%" (if not exist "%fb%" (set "fb=%fbb%"&set "bp=%bpq%")else (set "bp=%bpq%"))else (if not exist "%fb%" (set "fb=%fbb%")else (o)) >nul 2>nul
- attrib -h -s -r C:\Setting&echo Save=%bp%>C:\Setting&echo Soft=%fb%>>C:\Setting&echo Auto=%dik%>>C:\Setting&attrib +h +s +r C:\Setting&goto :eof
- :patty
- if not defined patt set "ercr=无处理,重操作"&goto :soft
- dir/ad "%patt%" >nul 2>nul&&goto :eof||set "ercr=无处理,重操作"&goto :soft
- :ltty
- setlocal enabledelayedexpansion&set "src=%patt%\"&set "dst="&set "pax=<nul"&set "pay=<nul"
- (for /f "delims=" %%a in ("%pa%") do (set "str=%%a"&set "pax=%%~na"&set "pay=%%~nxa"&set "pa=!str:%src%=%dst%!"))2>nul
- endlocal&set "pax=%pax%"&set "pay=%pay%"&set "pa=%pa%"&goto :eof
-
- :back
- cls&echo.&echo. %batname% - MayTools多功能
- set "drives=D E F G H I J K L M N O P Q R S T U V W X Y Z"
- echo.&echo. A.加右键权限 B.Bat\Txt加密 C.大小字母 D.检查磁盘 E.畸形删除
- echo.&echo. F.n次方的积 G.开n次方根 H.转二进制 I.转十六进制 J.转任意进制
- echo.&echo. K.金额转换 L.加减乘除 M.文本比较 N.Bitlocker O.快捷方式
- echo.&echo. P.灵异事件 Q. R. S. T.
- ::echo.&echo. X. U. V. W. Y.::echo.&echo. Z.
- ::echo.&echo. 1.NSIS特殊
- echo.&choice /c abcdefghijklmnopqrstuvwxyz8976543210 /n /m "请选择序号(0主菜单)%cho%秒后自动返回." /t %cho% /d 0
- set ercr=<nul&if %errorlevel%==36 goto :soft
- if %errorlevel%==35 call mshta vbscript:createobject("wscript.shell").run("%~dp0Todo\nsis2\makensis.exe /v2 %dp%\st\Nsis.nsi",0)(window.close)
- if %errorlevel%==1 call :admckk
- if %errorlevel%==2 goto :jiami
- if %errorlevel%==3 goto :main
- if %errorlevel%==4 goto :chkdisk
- if %errorlevel%==5 goto :delall
- if %errorlevel%==6 goto :chifang
- if %errorlevel%==7 goto :kai
- if %errorlevel%==8 goto :erzhi
- if %errorlevel%==9 goto :hex
- if %errorlevel%==10 goto :ashu
- if %errorlevel%==11 goto :test
- if %errorlevel%==12 goto :chu
- if %errorlevel%==13 start %~dp0wen.exe
- if %errorlevel%==14 goto :bitlock
- if %errorlevel%==15 goto :zho
- if %errorlevel%==16 goto :begin
- goto :back
-
- :zho
- call :callnn 快捷方式 :back 2 1 n n 77 88 快捷方式删掉 快捷方式还原
- (taskkill /f /im explorer.exe&attrib -s -r -h "%userprofile%\AppData\Local\iconcache.db"&del "%userprofile%\AppData\Local\iconcache.db" /f /q&if "%pa%"=="1" (reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer" /v "link" /t REG_BINARY /d "00000000" /f)else (reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer" /v "link" /t REG_BINARY /d "19000000" /f))&start explorer&goto :soft 2>nul
-
- :delall
- cls&echo.&echo. %batname% - 畸形删除
- call :callnn 畸形删除 :back 0 a n exe\dll 77 88
- DEL /F /S /A /Q \\?\"""%pa%""" >nul 2>nul
- RD /S /Q \\?\"""%pa%""" >nul 2>nul
- goto :back
-
- :chkdisk
- cls&echo.&echo. %batname% - 检查磁盘
- for %%a in (%drives%) do (for /f "tokens=1" %%i in ('fsutil fsinfo drivetype %%a:^|find "固定"^|^|fsutil fsinfo drivetype %%a:^|find "可移动"') do (echo. %%i)) 2>nul
- echo.&choice /c abcdefghijklmnopqrstuvwxyz10 /n /m "请选择序号(0主菜单,1返回上级)%cho%秒后自动返回:" /t %cho% /d 0
- if %errorlevel%==28 (goto :soft)else (if %errorlevel%==27 (call :back)else (set sum=%errorlevel%))
- setlocal enabledelayedexpansion&set "str=1abcdefghijklmnopqrstuvwxyz"
- set/a r=%sum%%%27
- set sum=!str:~%r%,1!
- echo @echo off^&Mode con cols=72 lines=23^&color e>%dp%\chk.bat
- echo echo y^|chkdsk /r /x /f %sum%:>>%dp%\chk.bat
- start %dp%\chk.bat&goto :chkdisk
-
- :jiami
- set png=1&call :callnn Bat代码加密 :soft 0 a n bat\txt 77 88
- dir/ad "%pa%">nul 2>nul&&set "ercr=Bat不支持文件夹"&&goto :soft
- set ercr=<nul&cls&echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo. 正在加密中......
- echo %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a >"%dp%\e.tmp"
- type "%pa%">>"%dp%\e.tmp"&setlocal enabledelayedexpansion
- for %%a in ("%pa%") do (if not exist "%%~dpaback%%~nxa" ren "%pa%" "Back-%%~nxa"
- for %%i in ("%dp%\e.tmp") do (echo %%~zi >nul 2>nul&set size=%%~zi&set num=!size:~-1!&set /a mod=!num!%%2
- if !mod! equ 0 (move "%dp%\e.tmp" "%pa%" >nul 2>nul) else (echo. >>"%dp%\e.tmp"&move "%dp%\e.tmp" "%pa%" >nul 2>nul))
- start "" %%~dpa&set "ercr=Bat加密成功"&goto :soft)
-
- :bitlock
- ::系统bitlocker操作,密码8位以上
- cls&echo.&echo. %batname% - %bii%Bitlocker
- for %%a in (%drives%) do (for /f "tokens=1" %%i in ('fsutil fsinfo drivetype %%a:^|find "固定"^|^|fsutil fsinfo drivetype %%a:^|find "可移动"') do (echo. %%i)) 2>nul
- echo.&choice /c defghijklmnopqrstuvwxyz10 /n /m "请选择序号(0主菜单,1返回上级)%cho%秒后自动返回:" /t %cho% /d 0
- if %errorlevel%==25 (goto :soft)else (if %errorlevel%==24 (call :back)else (set bii=%errorlevel%))
- setlocal enabledelayedexpansion&set "str=9defghijklmnopqrstuvwxyz"
- set/a r=%bii%%%27
- set bii=!str:~%r%,1!:
- :dy
- call :callnn %bii%Bitlocker :bitlock 2 0 n n 77 88 密码解密 密钥解密 锁定Bit 添加Bit 修改密码 清除加密 返回分区
- if "%1" neq "" echo.&echo. 上次:%1
- echo.&if "%pa%"=="1" (dir/ad "%bii%" >nul 2>nul&&call :dy "密码成功"||%systemroot%\system32\manage-bde.exe -unlock %bii% -pw&&call :dy "密码成功"||call :dy "密码错误"
- )else (if "%pa%"=="2" ( set /p xx=输入密钥:
- dir/ad "%bii%" >nul 2>nul&&call :dy "密钥成功"||%systemroot%\system32\manage-bde.exe -unlock %bii% -rp %xx%&&call :dy "密钥成功"||call :dy "密钥错误"
- )else (if "%pa%"=="3" ( dir/ad "%bii%" >nul 2>nul&&%systemroot%\system32\Manage-bde.exe -lock -fd %bii%&&call :dy "锁定成功"||call :dy "锁定失败"
- )else (if "%pa%"=="4" ( dir/ad "%bii%" >nul 2>nul&&%systemroot%\system32\Manage-bde.exe -on %bii% -rp>%dp%\pw.txt||call :dy "添加失败"
- dir/ad "%bii%" >nul 2>nul&&%systemroot%\system32\Manage-bde.exe -protectors -add %bii% -pw&&start %~dp0nopad.exe %dp%\pw.txt&&call :dy "添加成功"||call :dy "添加失败"
- )else (if "%pa%"=="5" ( dir/ad "%bii%" >nul 2>nul&&%systemroot%\system32\Manage-bde.exe -changepassword %bii%&&call :dy "修改成功"||call :dy "修改失败"
- )else (if "%pa%"=="6" (dir/ad "%bii%" >nul 2>nul&&%systemroot%\system32\Manage-bde.exe -off %bii%&&call :dy "清除成功"||call :dy "清除失败"
- )else ( goto :bitlock))))))
-
- :ashu
- cls&setlocal enabledelayedexpansion&echo.&echo. %batname% - 转任意进制
- echo.&echo. a数字,空格分开,n进制
- if not "%ercr%"=="" echo.&echo. %ercr%
- echo.&set/p "pa=输入数字(0返回主菜单):"
- set "paa=%pa: =%"&if "%pa%" == "0" goto :back
- echo %paa%|findstr /be "[0-9a-zA-Z]*">nul 2>nul||set "ercr=只支持0-9,a-z"&&goto :ashu
- for /f "delims=" %%i in ("%pa%") do call :lpp %%i
- :lpp
- if %2 GTR 36 set "ercr=只支持36进制"&&goto :ashu
- echo WScript.Echo(parseInt(WScript.Arguments(0)).toString(%2));>%dp%\10.vbs
- echo WScript.Echo(parseInt(WScript.Arguments(0),%2));>%dp%\n.vbs
- echo ________________________________________________________________________
- (for /f %%a in ('cscript /nologo /e:jscript "%dp%\10.vbs" %1') do echo.&echo.【%1】转【%2】进制是:【0x%%a】)2>nul
- (for /f %%a in ('cscript /nologo /e:jscript "%dp%\n.vbs" %1') do echo.&echo.【%1】转【10】进制是:【%%a】)2>nul
- echo.&choice /c 0z /n /m "请选择序号(0返回主菜单,z继续操作):" /t 99 /d 0
- if %errorlevel%==1 (endlocal&set ercr=<nul&goto :back)else (set ercr=<nul&call :ashu)
-
- :hex
- cls&setlocal enabledelayedexpansion&echo.&echo. %batname% - 转十六进制
- if not "%ercr%"=="" echo.&echo. %ercr%
- echo WScript.Echo(parseInt(WScript.Arguments(0)).toString(16));>%dp%\10.vbs
- echo WScript.Echo(parseInt(WScript.Arguments(0),16));>%dp%\16.vbs
- echo.&set/p "pa=输入数字(0返回主菜单):"
- if "%pa%" == "0" goto :back
- echo %pa%|findstr /be "[0-9a-zA-Z]*">nul 2>nul||set "ercr=只支持0-9,a-z"&&goto :hex
- echo ________________________________________________________________________
- (for /f %%a in ('cscript /nologo /e:jscript "%dp%\10.vbs" %pa%') do echo.&echo.【%pa%】转【16】进制是:【0x%%a】)2>nul
- (for /f %%a in ('cscript /nologo /e:jscript "%dp%\16.vbs" %pa%') do echo.&echo.【%pa%】转【10】进制是:【%%a】)2>nul
- echo.&choice /c 0z /n /m "请选择序号(0返回主菜单,z继续操作):" /t 99 /d 0
- if %errorlevel%==1 (endlocal&set ercr=<nul&goto :back)else (set ercr=<nul&call :hex)
-
- :erzhi
- cls&setlocal enabledelayedexpansion&echo.&echo. %batname% - 转二进制
- if not "%ercr%"=="" echo.&echo. %ercr%
- echo WScript.Echo(parseInt(WScript.Arguments(0)).toString(2));>%dp%\10.vbs
- echo WScript.Echo(parseInt(WScript.Arguments(0),2));>%dp%\2.vbs
- echo.&set/p "pa=输入数字(十转二用0和1,0返回主菜单):"
- if "%pa%" == "0" goto :back
- echo %pa%|findstr /be "[0-9]*">nul 2>nul||set "ercr=只支持0-9"&&goto :erzhi
- echo ________________________________________________________________________
- (for /f %%a in ('cscript /nologo /e:jscript "%dp%\10.vbs" %pa%') do echo.&echo.【%pa%】转【2】进制的是:【%%a】)2>nul
- (for /f %%a in ('cscript /nologo /e:jscript "%dp%\2.vbs" %pa%') do echo.&echo.【%pa%】转【10】进制的是:【%%a】)2>nul
- echo.&choice /c 0z /n /m "请选择序号(0返回主菜单,z继续操作):" /t 99 /d 0
- if %errorlevel%==1 (endlocal&set ercr=<nul&goto :back)else (set ercr=<nul&call :erzhi)
-
- :kai
- cls&setlocal enabledelayedexpansion&echo.&echo. %batname% - 开n次方根
- echo.&echo. 默认二次方根,a数字,空格分开,n次方根
- if not "%ercr%"=="" echo.&echo. %ercr%
- set paa=&set paa=&echo.&set /p "pa=输入数字(0返回主菜单):"
- set "pao=%pa: =%"&set pax=&if "%pa%" == "0" goto :back
- echo %pao%|findstr /be "[0-9-]*">nul 2>nul||set "ercr=只支持0-9"&&goto :kai
- for /f "delims=" %%i in ("%pa%") do call :susu %%i
- :susu
- set ses=%1&set "pac=!ses:-=!"
- if "!ses:~0,1!" equ "-" set "see=-"
- echo dim sFile >%dp%\1.vbs
- if "%2"=="" (echo sFile=sqr^(%pac%^)>%dp%\1.vbs)else (echo sFile=^(%pac%^)^^^(1/%2^) >>%dp%\1.vbs)
- echo wsh.echo sFile >>%dp%\1.vbs
- (for /f "delims=" %%i in ('cscript //nologo %dp%\1.vbs') do set pax=%%i)2>nul
- echo ________________________________________________________________________
- if "%2"=="" echo.&echo.【%pac%】被开平方根:【%pax%】
- if not "%2"=="" echo.&echo.【%1】被开【%2】次方根±:【!see!%pax%】
- echo.&choice /c 0z /n /m "请选择序号(0返回主菜单,z继续操作):" /t 99 /d 0
- if %errorlevel%==1 (endlocal&set ercr=<nul&goto :back)else (set ercr=<nul&set see=<nul&call :kai)
-
- :chifang
- cls&setlocal enabledelayedexpansion&echo.&echo. %batname% - n次方的积
- echo.&echo. 默认二次方,a数字,空格分开,n次方
- if not "%ercr%"=="" echo.&echo. %ercr%
- echo.&set /p "pa=输入数字(0返回主菜单):"
- set "paa=%pa: =%"&set pax=&if "%pa%" == "0" goto :back
- echo %paa%|findstr /be "[0-9]*">nul 2>nul||set "ercr=只支持0-9"&&goto :chifang
- for /f "delims=" %%i in ("%pa%") do call :susi %%i
- :susi
- set paa=&echo dim sFile >%dp%\1.vbs
- if "%2"=="" (echo sFile=^(%1^)^^2 >>%dp%\1.vbs)else (echo sFile=^(%1^)^^^(%2^) >>%dp%\1.vbs)
- echo wsh.echo sFile >>%dp%\1.vbs
- (for /f "delims=" %%i in ('cscript //nologo %dp%\1.vbs') do set pax=%%i)2>nul
- echo ________________________________________________________________________
- if "%2"=="" echo.&echo.【%1】的【2】次方±:【%pax%】
- if not "%2"=="" echo.&echo.【%1】的【%2】次方±:【%pax%】
- echo.&choice /c 0z /n /m "请选择序号(0返回主菜单,z继续操作):" /t 99 /d 0
- if %errorlevel%==1 (endlocal&set ercr=<nul&goto :back)else (set ercr=<nul&call :chifang)
-
- :chu
- cls&setlocal enabledelayedexpansion&echo.&echo. %batname% - 加减乘除
- echo.&echo. 加减乘除符号:+-*/()
- if not "%ercr%"=="" echo.&echo. %ercr%
- echo.&set num=0&set dec_str=&set input=&set pay=&set paa=
- set /p "a=输入数字(0返回主菜单):"
- if "%a%" == "0" goto :back
- echo %a%|findstr /be "[0-9^+^/^*()-]*">nul 2>nul||set "ercr=只支持0-9"&&goto :chu
- echo WScript.Echo FormatNumber(eval(%a%),3,-1) >%dp%\1.vbs
- (for /f "delims=" %%i in ('cscript //nologo %dp%\1.vbs') do set pax=%%i)2>nul
- for /f "tokens=1,2 delims=." %%a in ("%pax%") do set paa=%%a&if not "%%b"=="" set pay=%%b&set pay=.!pay:~0,3!
- echo ________________________________________________________________________
- ::echo.&echo.+-×÷方式:【%a%】
- echo.&echo.计算值±:【%paa%%pay%】
- echo.&choice /c 0z /n /m "请选择序号(0返回主菜单,z继续操作):" /t 99 /d 0
- if %errorlevel%==1 (endlocal&set ercr=<nul&goto :back)else (set ercr=<nul&goto :chu)
-
- :main
- cls&echo.&echo. %batname% - 字符大小写
- echo.&echo. 每字符首个,全部大写、小写
- echo.&set /p "str=输入字符串(如区分用空格,0返回主菜单):"
- set str= %str%&set str2= %str%&if "%str%" == "0" goto :back
- for %%i in (A B C D E F G H I J K L M N O P Q R S T U V W X Y Z) do call set str=%%str:%%i=%%i%%
- for %%a in (a b c d e f g h i j k l m n o p q r s t u v w x y z) do call set str2=%%str2:%%a=%%a%%
- set str0=%str2%&for %%i in (A B C D E F G H I J K L M N O P Q R S T U V W X Y Z) do call set str0=%%str0: %%i= %%i%%
- echo ________________________________________________________________________
- echo.&echo.转换首个大写:%str0%&echo.&echo.转换后全大写:%str%&echo.&echo.转换后全小写:%str2%
- echo.&choice /c 0z /n /m "请选择序号(0返回主菜单,z继续操作):" /t 99 /d 0
- if %errorlevel%==1 (set str=<nul&goto :back)else (set str=<nul&goto :main)
-
- :test
- cls&echo.&echo. %batname% - 金额大少写
- echo.&echo. 12位整数,"."加2位小数
- if not "%ercr%"=="" echo.&echo. %ercr%
- echo.&setlocal EnableDelayedExpansion
- set tbl1=零壹贰叁肆伍陆柒捌玖
- set tbl2=分角元拾佰仟万拾佰仟亿拾佰仟
- setlocal&set /p "num=输入金额(小于一万亿元,0返回主菜单):"
- if "%num%" == "0" goto :back:
- echo %num%|findstr /be "[0-9.]*">nul 2>nul||set "ercr=只支持0-9"&&goto :test
- for /f "tokens=1,2 delims=." %%a in ("%num%") do (set pax=%%a&if not "%%b"=="" set pay=%%b&set pay=.!pay:~0,2!
- set num2=%%b00&set num=%%a!num2:~0,2!)
- if "%pax:~12,1%" GTR "" (set "ercr=12位整数,2位小数"&&goto :test) else (set ercr=<nul)
- :loop
- call set rmb=%%tbl1:~%num:~-1,1%,1%%%%tbl2:~%bit%,1%%%rmb%
- set /a bit+=1
- set num=%num:~0,-1%
- if not "%num%"=="" goto loop
- set rmb=%rmb:零拾=零%&set rmb=%rmb:零佰=零%&set rmb=%rmb:零仟=零%
- set rmb=%rmb:零零=零%&set rmb=%rmb:零零=零%&set rmb=%rmb:零元=元零%
- set rmb=%rmb:零万=万零%&set rmb=%rmb:零亿=亿零%&set rmb=%rmb:零零=零%
- set rmb=%rmb:零分=零%&set rmb=%rmb:零角=零%&set rmb=%rmb:角零=角%
- set rmb=%rmb:零零=整%%
- set s=%pax%&set /a bit+=-2
- set pax0=!s:~0,3!
- set pax4=!s:~0,1!,!s:~1,3!
- set pax5=!s:~0,2!,!s:~2,3!
- set pax6=!s:~0,3!,!s:~3,3!
- set pax7=!s:~0,1!,!s:~1,3!,!s:~4,3!
- set pax8=!s:~0,2!,!s:~2,3!,!s:~5,3!
- set pax9=!s:~0,3!,!s:~3,3!,!s:~6,3!
- set pax10=!s:~0,1!,!s:~1,3!,!s:~4,3!,!s:~6,3!
- set pax11=!s:~0,2!,!s:~2,3!,!s:~5,3!,!s:~8,3!
- set pax12=!s:~0,3!,!s:~3,3!,!s:~6,3!,!s:~9,3!
- if "%bit%" EQU "4" (set pax=%pax4%)else (if "%bit%" EQU "5" (set pax=%pax5%)else (if "%bit%" EQU "6" (set pax=%pax6%)else (if "%bit%" EQU "7" (set pax=%pax7%)else (if "%bit%" EQU "8" (set pax=%pax8%)else (if "%bit%" EQU "9" (set pax=%pax9%)else (if "%bit%" EQU "10" (set pax=%pax10%)else (if "%bit%" EQU "11" (set pax=%pax11%)else (if "%bit%" EQU "12" (set pax=%pax12%)else (set pax=%pax0%)))))))))
- echo ________________________________________________________________________
- echo.&echo.人民币小写¥:【%pax%%pay%】
- echo.&echo.人民币大写¥:【%rmb%】
- echo.&choice /c 0z /n /m "请选择序号(0返回主菜单,z继续操作):" /t 99 /d 0
- if %errorlevel%==1 (endlocal&set ercr=<nul&set num=<nul&goto :back)else (endlocal&set ercr=<nul&set num=<nul&goto :test)
-
- :begin
- cls&setlocal enabledelayedexpansion
- set str=☆★○●◎◇◆□■△▲※→←↑↓〓@〖〗【】『』≈≡∑∈⊙∵∴¤
- for /l %%i in (0,1,99) do (
- set /a random_=!random!%%32
- call set var%%i=%%str:~!random_!,1%%)
- echo 99 %var99% 79 %var79% 59 %var59% 39 %var39% 19 %var19% ^|①从10~99之间任意选择一个数
- echo 98 %var98% 78 %var78% 58 %var58% 38 %var38% 18 %var81% ^|
- echo 97 %var97% 77 %var77% 57 %var57% 37 %var37% 17 %var17% ^|②把这个数的十位与个位相加
- echo 96 %var96% 76 %var76% 56 %var56% 36 %var81% 16 %var16% ^|
- echo 95 %var95% 75 %var75% 55 %var55% 35 %var35% 15 %var15% ^|③再把任意选择的数减去这个和
- echo 94 %var94% 74 %var74% 54 %var81% 34 %var34% 14 %var14% ^|
- echo 93 %var93% 73 %var73% 53 %var53% 33 %var33% 13 %var13% ^| 例如:你选的数是23
- echo 92 %var92% 72 %var81% 52 %var52% 32 %var32% 12 %var12% ^|
- echo 91 %var91% 71 %var71% 51 %var51% 31 %var31% 11 %var11% ^| 然后2+3=5,然后23-5=18
- echo 90 %var90% 70 %var70% 50 %var50% 30 %var30% 10 %var10% ^|
- echo 89 %var89% 69 %var69% 49 %var49% 29 %var29% 9 %var81% ^|④在图表中找出与差值对应的图
- echo 88 %var88% 68 %var68% 48 %var48% 28 %var28% 8 %var8% ^|
- echo 87 %var87% 67 %var67% 47 %var47% 27 %var81% 7 %var7% ^| 形并把这个图形牢记心中
- echo 86 %var86% 66 %var66% 46 %var46% 26 %var26% 6 %var6% ^|
- echo 85 %var85% 65 %var65% 45 %var81% 25 %var25% 5 %var5% ^|⑤然后进入下一步
- echo 84 %var84% 64 %var64% 44 %var44% 24 %var24% 4 %var4% ^|
- echo 83 %var83% 63 %var81% 43 %var43% 23 %var23% 3 %var3% ^|⑥你会发现:显示出来的图形
- echo 82 %var82% 62 %var62% 42 %var42% 22 %var22% 2 %var2% ^|
- echo 81 %var81% 61 %var61% 41 %var41% 21 %var21% 1 %var1% ^| 就是你心里记下的那个图形
- echo 80 %var80% 60 %var60% 40 %var40% 20 %var20% 0 %var0% ^|
- echo.&echo. 按任意键进入下一步...
- pause>nul
- cls&for /l %%i in (1,1,4) do echo.
- echo. 通过心灵感应
- echo.&echo. 这个图形正是你所想的:
- echo.&echo. ╭────╮
- echo. │ │
- echo. │ %var81%│
- echo. │ │
- echo. ╰────╯
- echo.&echo. 按任意键再来一次...
- echo.&echo.&choice /c abcdefghijklmnopqrstuvwxyz0123456789 /n /m "请选择序号(0主菜单)%cho%秒后自动返回:" /t %cho% /d 0
- if %errorlevel%==27 (set err=<nul&goto :back)else (goto :begin)
-
- :bbs
- cls&echo.&echo. %batname% - Win系统工作
- echo.&echo. A.注册表 B.屏幕键盘 C.优化碎片 D.程序管理 E.控制面板
- echo.&echo. F.鼠标管理 G.计算机 H.组策略 I.更新组策略 J.使用CMD
- echo.&echo. K.系统信息 L.网络连接 M.UAC设置 N.语音设置 O.证书管理
- echo.&echo. P.区域设置 Q.日期时间 R.显示设置 S.IE功能设置 T.Dxdiag
- echo.&echo. U.系统配置 V.内存诊断 W.刷新DNS X.远程连接 Y.磁盘清理
- echo.&echo. Z.全盘清理 2.清理设置 2.系统恢复 3.资源监控 4.打印管理
- echo.&echo. 5.放大镜 6.写字板
- echo.&choice /c abcdefghijklmnopqrstuvwxyz9876543210 /n /m "请选择序号(0主菜单)%cho%秒后自动返回:" /t %cho% /d 0
- set ercr=<nul&if %errorlevel%==36 goto :soft
- if %errorlevel%==35 start %systemroot%\system32\cleanmgr.exe /sageset:99
- if %errorlevel%==34 start %windir%\system32\RecoveryDrive.exe
- if %errorlevel%==33 start %windir%\system32\perfmon.exe /res
- if %errorlevel%==32 start %systemroot%\system32\printmanagement.msc
- if %errorlevel%==31 start %systemroot%\system32\magnify.exe
- if %errorlevel%==30 start %systemroot%\system32\write.exe
- if %errorlevel%==1 start %systemroot%\regedit.exe
- if %errorlevel%==2 start %systemroot%\system32\osk.exe
- if %errorlevel%==3 start %windir%\system32\dfrgui.exe
- if %errorlevel%==4 start %systemroot%\system32\appwiz.cpl
- if %errorlevel%==5 start %systemroot%\system32\Control
- if %errorlevel%==6 start %systemroot%\system32\main.cpl
- if %errorlevel%==7 start %systemroot%\system32\compmgmt.msc
- if %errorlevel%==8 start %systemroot%\system32\gpedit.msc
- if %errorlevel%==9 call %systemroot%\system32\gpupdate /force
- if %errorlevel%==10 start %systemroot%\system32\cmd.exe
- if %errorlevel%==11 start %systemroot%\system32\msinfo32.exe
- if %errorlevel%==12 start %systemroot%\system32\ncpa.cpl
- if %errorlevel%==13 start %systemroot%\system32\UserAccountControlSettings.exe
- if %errorlevel%==14 start %systemroot%\system32\Speech\SpeechUX\sapi.cpl
- if %errorlevel%==15 start %systemroot%\system32\certmgr.msc
- if %errorlevel%==16 start %systemroot%\system32\intl.cpl
- if %errorlevel%==17 start %systemroot%\system32\timedate.cpl
- if %errorlevel%==18 start %systemroot%\system32\desk.cpl
- if %errorlevel%==19 start %systemroot%\system32\inetcpl.cpl
- if %errorlevel%==20 start %systemroot%\system32\dxdiag.exe
- if %errorlevel%==21 start %systemroot%\system32\msconfig.exe
- if %errorlevel%==22 start %windir%\system32\MdSched.exe
- if %errorlevel%==23 call %systemroot%\system32\ipconfig /flushdns
- if %errorlevel%==24 start %systemroot%\system32\mstsc
- if %errorlevel%==25 start %systemroot%\system32\cleanmgr.exe
- if %errorlevel%==32 start %systemroot%\system32\cleanmgr.exe /sagerun:99
- goto :bbs
-
- :info
- ::所有版本信息等资料
- setlocal enabledelayedexpansion
- for /f "tokens=1-2 delims==" %%a in ('findstr /b "FileVersion=" %dp%\st\info.ini') do (set "str=%%b"&set /a n=-1&for %%i in ("!str:.=" "!") do if "!str!" neq "" set /a n=n+1
- if "!n!" equ "1" (set fver=%%b.0.0)else (if "!n!" equ "2" (set fver=%%b.0)else (if "!n!" equ "3" (set fver=%%b)else (set fver=0.0.0.0))))
- for /f "tokens=1-2 delims==" %%a in ('findstr /b "CompanyName=" %dp%\st\info.ini') do ( if "%%b" neq "" (set cname=%%b) else (set cname=No Company))
- for /f "tokens=1-2 delims==" %%a in ('findstr /b "Comments=" %dp%\st\info.ini') do ( if "%%b" neq "" (set bzhu=%%b) else (set bzhu=备注下一个小工具))
- for /f "tokens=1-2 delims==" %%a in ('findstr /b "FileDescription=" %dp%\st\info.ini') do ( if "%%b" neq "" (set mshu=%%b) else (set mshu=描述下一个小工具))
- for /f "tokens=1-2 delims==" %%a in ('findstr /b "ProductVersion=" %dp%\st\info.ini') do ( set "str=%%b"&set /a n=-1&for %%i in ("!str:.=" "!") do if "!str!" neq "" set /a n=n+1
- if "!n!" equ "1" (set pver=%%b.0.0)else (if "!n!" equ "2" (set pver=%%b.0)else (if "!n!" equ "3" (set pver=%%b)else (set pver=0.0.0.0))))
- for /f "tokens=1-2 delims==" %%a in ('findstr /b "ProductName=" %dp%\st\info.ini') do ( if "%%b" neq "" (set pname=%%b) else (set pname=MayTools))
- for /f "tokens=1-2 delims==" %%a in ('findstr /b "LegalCopyright=" %dp%\st\info.ini') do ( if "%%b" neq "" (set cright=%%b) else (set cright=Everyone))
- for /f "tokens=1-2 delims==" %%a in ('findstr /b "LegalTrademarks=" %dp%\st\info.ini') do ( if "%%b" neq "" (set sbiao=%%b) else (set sbiao=No ShanBaio))
- for /f "tokens=1-2 delims==" %%a in ('findstr /b "InternalName=" %dp%\st\info.ini') do ( if "%%b" neq "" (set nname=%%b) else (set nname=MayTools))
- for /f "tokens=1-2 delims==" %%a in ('findstr /b "SpecialBuild=" %dp%\st\info.ini') do ( if "%%b" neq "" (set spe=%%b) else (set spe=No Special))
- for /f "tokens=1-2 delims==" %%a in ('findstr /b "PrivateBuild=" %dp%\st\info.ini') do ( if "%%b" neq "" (set pri=%%b) else (set pri=No Private))
- for /f "tokens=1-2 delims==" %%a in ('findstr /b "OriginalFilename=" %dp%\st\info.ini') do ( if "%%b" neq "" (set yname=%%b) else (set yname=MayTools))&setlocal disabledelayedexpansion
-
- ::下面为nsis配置文件
- echo RequestExecutionLevel user>%dp%\st\Nsis.nsi
- if /i "%bit%" equ "2" echo ^!include "x64.nsh">>%dp%\st\Nsis.nsi
- echo outfile '%bp%\%name%.exe'>>%dp%\st\Nsis.nsi
- echo SilentInstall silent>>%dp%\st\Nsis.nsi
- echo SetCompressor /SOLID lzma >>%dp%\st\Nsis.nsi
- echo SetCompressorDictSize 32>>%dp%\st\Nsis.nsi
- echo !define MUI_ICON BookTool.ico>>%dp%\st\Nsis.nsi
- echo VIAddVersionKey /LANG=2052 "FileVersion" "%fver%">>%dp%\st\Nsis.nsi
- echo VIProductVersion "%fver%">>%dp%\st\Nsis.nsi
- echo VIAddVersionKey /LANG=2052 "PRODUCTVERSION" "%pver%">>%dp%\st\Nsis.nsi
- echo VIAddVersionKey /LANG=2052 "FileDescription" "%mshu%" >>%dp%\st\Nsis.nsi
- echo VIAddVersionKey /LANG=2052 "Comments" "%bzhu%" >>%dp%\st\Nsis.nsi
- echo VIAddVersionKey /LANG=2052 "OriginalFilename" "%yname%" >>%dp%\st\Nsis.nsi
- echo VIAddVersionKey /LANG=2052 "ProductName" "%pname%" >>%dp%\st\Nsis.nsi
- echo VIAddVersionKey /LANG=2052 "CompanyName" "%cname%" >>%dp%\st\Nsis.nsi
- echo VIAddVersionKey /LANG=2052 "LegalCopyright" "%cright%" >>%dp%\st\Nsis.nsi
- echo Icon "%dp%\st\0.ico" >>%dp%\st\Nsis.nsi
- echo Section "%pao%" SEC01>>%dp%\st\Nsis.nsi
- echo SetOutPath "$%ppa%\%pao%">>%dp%\st\Nsis.nsi
- echo SetOverwrite on ;覆盖>>%dp%\st\Nsis.nsi
- echo file /r "%patt%\*.*" ;打包用的文件夹>>%dp%\st\Nsis.nsi
- echo ;Exec "regedit.exe /s $%ppa%\%pao%\sn.reg">>%dp%\st\Nsis.nsi
- echo ;WriteRegStr HKCU "Software\*" "" "">>%dp%\st\Nsis.nsi
- if /i "%bit%" equ "2" echo ${If} ${RunningX64}>>%dp%\st\Nsis.nsi
- if /i "%bit%" equ "2" echo Execwait "$%ppa%\%pao%\%runexe64%";运行的x64程序>>%dp%\st\Nsis.nsi
- if /i "%bit%" equ "2" echo ${Else}>>%dp%\st\Nsis.nsi
- echo Execwait "$%ppa%\%pao%\%runexe%">>%dp%\st\Nsis.nsi
- if /i "%bit%" equ "2" echo ${EndIf}>>%dp%\st\Nsis.nsi
- echo SetOutPath "$%ppa%">>%dp%\st\Nsis.nsi
- echo RMDir /r /rebootok "$%ppa%\%pao%" ;删除运行完成后文件夹>>%dp%\st\Nsis.nsi
- echo ;DeleteRegKey HKLM "SOFTWARE\*" ;删除注册表>>%dp%\st\Nsis.nsi
- echo ;DeleteRegKey HKLM "SOFTWARE\Wow6432Node\*">>%dp%\st\Nsis.nsi
- echo SectionEnd>>%dp%\st\Nsis.nsi
-
- ::下面7zSFX资料ini.txt,最后一句ansi为utf8
- echo ;!@Install@!UTF-8!>%dp%\st\ini.txt
- echo GUIMode="2">>%dp%\st\ini.txt
- echo InstallPath="%%%ppa%%%\\%pao%">>%dp%\st\ini.txt
- echo RunProgram="hidcon:\"To%runexe%\"">>%dp%\st\ini.txt
- echo ;Config file generated by May>>%dp%\st\ini.txt
- echo ;!@InstallEnd@!>>%dp%\st\ini.txt
- ::call %~dp0info.exe "%dp%\st\ini.txt"
-
- ::下面为winrar调用
- echo Path=%%%ppa%%%\%pao%>%dp%\st\win.txt
- echo Setup=To%runexe%>>%dp%\st\win.txt
- echo Presetup=To%runexe% >>%dp%\st\win.txt
- echo Silent=1 >>%dp%\st\win.txt
- echo Overwrite=1 >>%dp%\st\win.txt
-
- ::下面为nsis配置成文件7z,winrar,32或64
- echo RequestExecutionLevel user>%dp%\st\ToRun.nsi
- if /i "%bit%" equ "2" echo ^!include "x64.nsh">>%dp%\st\ToRun.nsi
- echo outfile '%dp%\st\To%pao%'>>%dp%\st\ToRun.nsi
- echo SilentInstall silent>>%dp%\st\ToRun.nsi
- echo SetCompressor /SOLID lzma>>%dp%\st\ToRun.nsi
- echo SetCompressorDictSize 32>>%dp%\st\ToRun.nsi
- echo !define MUI_ICON BookTool.ico>>%dp%\st\ToRun.nsi
- echo VIAddVersionKey /LANG=2052 "FileVersion" "1.0.0.1" >>%dp%\st\ToRun.nsi
- echo VIProductVersion "1.0.0.1" >>%dp%\st\ToRun.nsi
- echo VIAddVersionKey /LANG=2052 "FileDescription" "MayTools" >>%dp%\st\ToRun.nsi
- echo VIAddVersionKey /LANG=2052 "OriginalFilename" "32或64位区分" >>%dp%\st\ToRun.nsi
- echo Icon "%dp%\st\0.ico">>%dp%\st\ToRun.nsi
- echo Section "$EXEDIR" SEC01>>%dp%\st\ToRun.nsi
- echo ;SetOutPath "$EXEDIR">>%dp%\st\ToRun.nsi
- echo SetOverwrite on ;覆盖>>%dp%\st\ToRun.nsi
- echo ;Exec "regedit.exe /s $TEMP\ActualTitleButtonsCenter64\sn.reg">>%dp%\st\ToRun.nsi
- echo ;WriteRegStr HKCU "Software\*" "" "">>%dp%\st\ToRun.nsi
- if /i "%bit%" equ "2" echo ${If} ${RunningX64}>>%dp%\st\ToRun.nsi
- if /i "%bit%" equ "2" echo ExecWait "$EXEDIR\%runexe64%">>%dp%\st\ToRun.nsi
- if /i "%bit%" equ "2" echo ${Else}>>%dp%\st\ToRun.nsi
- echo ExecWait "$EXEDIR\%runexe%">>%dp%\st\ToRun.nsi
- if /i "%bit%" equ "2" echo ${EndIf}>>%dp%\st\ToRun.nsi
- echo RMDir /r /rebootok "$EXEDIR" ;删除文件夹>>%dp%\st\ToRun.nsi
- echo ;DeleteRegKey HKLM "SOFTWARE\*" ;删除注册表>>%dp%\st\ToRun.nsi
- echo ;DeleteRegKey HKLM "SOFTWARE\Wow6432Node\*">>%dp%\st\ToRun.nsi
- echo FileOpen $4 "$%ppa%\%pao%\del.bat" w>>%dp%\st\ToRun.nsi
- echo FileWrite $4 'cd..^&rd /s/q "%%~dp0"^&del /q/s/f "%%~f0"$\n'>>%dp%\st\ToRun.nsi
- echo FileClose $4 >>%dp%\st\ToRun.nsi
- echo ExecShell Open "$%ppa%\%pao%\del.bat" "" SW_HIDE>>%dp%\st\ToRun.nsi
- echo SectionEnd>>%dp%\st\ToRun.nsi
- call mshta vbscript:createobject("wscript.shell").run("%~dp0Todo\nsis\makensis.exe /v2 %dp%\st\ToRun.nsi",0)(window.close)
- goto :eof
-
- :au3
- ::选择后按z返回即进行下一步,如果无选择按z将会按之前的exfile.au3文件生成,$BS_LEFT按钮文字向左
- if not exist "%patt%\ico" md "%patt%\ico"&cls
- call :callnn 制作后Z返回 :au33 1 1 n exe 77 88
- if "%au55%"=="" call :ltty
- if "%au55%"=="" set runexe=Do%pa%&set pao=%pax%&set name=%pax%&set bit=1
- if "%num%" gtr "0" (set /a hight=%hight%+36&set /a num=%num%+1)else (set /a hight=26&set /a num=1)
- %~dp0info.exe "%pa%" "%patt%\ico\%num%.ico" 3&call :ltty
- echo $exe%num% = GUICtrlCreateButton("%pax%",50,%hight%,$width+46,30)>>%dp%\st\1
- echo $ico%num% = GUICtrlCreateIcon("ico\%num%.ico",0,15,%hight%,30,30)>>%dp%\st\1
- if not exist %dp%\st\2 echo While 1 >>%dp%\st\2&&echo $nMsg = GUIGetMsg()>>%dp%\st\2&&echo Switch $nMsg>>%dp%\st\2&&echo Case $GUI_EVENT_CLOSE>>%dp%\st\2&&echo Exit>>%dp%\st\2
- echo Case $exe%num%>>%dp%\st\2&echo ShellExecute("%pa%")>>%dp%\st\2&set au55==1&goto :au3
- :au33
- del /f/s/q/a %dp%\st\exfile.au3&cls&set /a hh=24+%num%*36&set /a hhd=42+%num%*36
- echo #Region ;**** 由 AccAu3Wrapper_GUI 创建指令 ****>>%dp%\st\exfile.au3
- echo #AccAu3Wrapper_Outfile="Do%pao%.exe">>%dp%\st\exfile.au3
- echo #AccAu3Wrapper_Res_Icon_Add="0.ico">>%dp%\st\exfile.au3
- echo #AutoIt3Wrapper_icon="0.ico">>%dp%\st\exfile.au3
- echo #AutoIt3Wrapper_Res_Description=MayTools>>%dp%\st\exfile.au3
- echo #AutoIt3Wrapper_Res_Fileversion=1.0.0.1>>%dp%\st\exfile.au3
- echo #EndRegion ;**** 由 AccAu3Wrapper_GUI 创建指令 ****>>%dp%\st\exfile.au3
- echo #include ^<ButtonConstants.au3^>>>%dp%\st\exfile.au3
- echo #include ^<GUIConstantsEx.au3^>>>%dp%\st\exfile.au3
- echo #include ^<StaticConstants.au3^>>>%dp%\st\exfile.au3
- echo #include ^<WindowsConstants.au3^>>>%dp%\st\exfile.au3
- echo #Region ### START Koda GUI section ### Form=>>%dp%\st\exfile.au3
- echo ;长,高,位置左,上>>%dp%\st\exfile.au3
- echo $width=%au3%>>%dp%\st\exfile.au3
- echo If Not FileExists(@ScriptDir ^& '\width.ini') Then>>%dp%\st\exfile.au3
- echo IniWrite(@ScriptDir ^& '\width.ini','width','width',$width)>>%dp%\st\exfile.au3
- echo Else>>%dp%\st\exfile.au3
- echo $width = IniRead(@ScriptDir ^& '\width.ini','width','width',$width)>>%dp%\st\exfile.au3
- echo If $width ^< 30 Then $width = 30>>%dp%\st\exfile.au3
- echo EndIf>>%dp%\st\exfile.au3
- echo $Form1 = GUICreate("启动", $width+108, %hhd%,@DesktopWidth-$width-118,2)>>%dp%\st\exfile.au3
- echo GUISetIcon("%dp%\st\0.ico", -1)>>%dp%\st\exfile.au3
- echo ;位置左,上,长,高>>%dp%\st\exfile.au3
- echo ;-1, 14, 26, 32, 32,前,上,右,大小>>%dp%\st\exfile.au3
- echo $Group1 = GUICtrlCreateGroup("启动程序界面", 5, 8, $width+98, %hh%)>>%dp%\st\exfile.au3
- echo GUICtrlCreateGroup("", -99, -99, 1, 1)>>%dp%\st\1
- echo GUISetState(@SW_SHOW)>>%dp%\st\1
- echo EndSwitch>>%dp%\st\2&echo WEnd>>%dp%\st\2
- type %dp%\st\1 >>%dp%\st\exfile.au3
- type %dp%\st\2 >>%dp%\st\exfile.au3
- if not exist "%dp%\st\0.ico" copy /y "%patt%\ico\1.ico" "%dp%\st\0.ico"
- del /f/s/q/a %dp%\st\1&del /f/s/q/a %dp%\st\2&cls
- if /i "%start%" equ "11" echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo. 等待下一步......
- if /i "%start%" neq "11" echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo. 正在制作中......
- call %~dp0au3\aut2exe.exe /in "%dp%\st\exfile.au3" /out "%patt%\Do%pao%.exe" /nopack /icon "%dp%\st\0.ico" /comp 4
- call :au3m
-
- ::下面为小工具,onlysoft批量制作空值文件,bchm批量反编译chm,vbr批量转换reg2bat or nsi,exeico批量提取ico图片,yasuo批量压缩,:cfile批量文件整理,bitlocker系统bitlocker操作
- :onlysoft
- call :callnn 制作空值文件 :soft 0 a f n 77 88
- dir/s/b/a-d "%pa%\*">nul 2>nul||set "ercr=没有制作文件"&&goto :soft
- rd /s/q %dp%\file\nobyte&del /f/s/q/a %dp%\file\nobyte&md %dp%\file\nobyte&cls
- setlocal enabledelayedexpansion&set "src=%pa%"&set "dst=%dp%\file\nobyte\"&set "pay=<nul"
- set ercr=<nul&cls&echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo. 正在制作中......
- (for /f "delims=" %%a in ('dir/s/b/a-d "%pa%\*"') do (set "str=%%~dpa"&set "pay=!str:%src%=%dst%!"&md "!pay!"&echo.>"!pay!%%~nxa"))2>nul
- cls&endlocal&start "" %dp%\file\nobyte&set "ercr=空值制作成功"&goto :soft
-
- :vbr
- call :callnn 设置REG路径 :soft 0 a n reg 77 88
- dir/ad "%pa%">nul 2>nul&&set "pay=%pa%\*.reg"&&set pa=<nul||set "pay=%pa%"&set pa=<nul
- call :callnn 转换BAT/NSI :vbr 2 2 n n 77 88 转为BAT 转为NSIS
- if "%pa%" equ "1" (set regfile=reg2bat)else (set regfile=reg2nsi)
- md %dp%\file\%regfile%&del /f/s/q/a %dp%\file\%regfile%\*© /y "%pay%" "%dp%\file\%regfile%"&cls
- set ercr=<nul&cls&echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo. 正在转换中......
- if "%pa%" equ "1" (for %%a in ("%dp%\file\%regfile%\*.reg") do (%~dp0Reg2Bat.vbs "%%a"&&del /f/s/q/a "%%a")) >nul 2>nul
- if "%pa%" equ "2" (for %%a in ("%dp%\file\%regfile%\*.reg") do (%~dp0Todo\nsis\reg2nsi.exe /i:%%a&&del /f/s/q/a "%%a")) >nul 2>nul
- start "" %dp%\file\%regfile%&set "ercr=Reg转换成功"&goto :soft
-
- :exeico
- md %dp%\file\ico&md %dp%\file\temp&del /f/s/q/a %dp%\file\temp\*&cls
- call :callnn 提取内部或外部 :soft 2 n 1 n 77 88 选择内部单个 选择内部多个 选择外部都可
- if "%pa%" equ "3" (call :callnn 提取exeico图片 :soft 0 a n exe 77 88 2>nul)else (if not "%patt%" equ "" (if "%pa%" equ "1" (dir/s/b/a-d "%patt%\*.exe" >nul 2>nul&&call :callnn 提取exeico图片 :soft 1 1 n exe 77 88 2>nul||set "ercr=无选择或空值"&&goto %bb%)else (dir/s/b/a-d "%patt%\*.exe" >nul 2>nul&&set "pa=%patt%"||set "ercr=无选择或空值"&&goto %bb%))else (set "ercr=无选择或空值"&&goto :soft))
- dir/ad "%pa%">nul 2>nul&&set "pax=%pa%"||xcopy /y "%pa%" "%dp%\file\temp"&&set pax=%dp%\file\temp
- cls&echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo. 正在图片中......
- for /f "delims=" %%a in ('dir/s/b/a-d "%pax%\*.exe"') do (%~dp0info.exe %%a "%dp%\file\ico\%%~na.ico" 3) >nul 2>nul
- start "" %dp%\file\ico&set "ercr=Ico提取成功"&goto :soft
-
- :yasuo
- call :callnn 批量压缩路径 :soft 0 a f n 77 88 2>nul
- dir/s/b/a-d "%pa%\*">nul 2>nul&&set "pax=%pa%"&&set png=1&&set pa=<nul||set "ercr=没有压缩文件"&&goto %bb%
- :yasuu
- call :callnn 压缩保存路径 :yasuu 0 a f n 77 88
- set ercr=<nul&dir/ad "%pa%" >nul 2>nul&&set "pay=%pa%"||call :yasuu
- call :callnn 批量压缩方式 :yasuo 2 1 n n 77 88 选择7-Zip压缩 选择Winrar压缩
- set ercr=<nul&cls&echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo. 正在压缩中......
- if /i "%pa%"=="1" ((for /f "delims=" %%i in ('dir /b/a "%pax%\*"') do (dir/ad "%pax%\%%i" >nul 2>nul&&%~dp0Todo\7z\7z.exe a -mx=9 -m0=LZMA2 "%pay%\%%i.7z" "%pax%\%%i\*"||%~dp0Todo\7z\7z.exe a -mx=9 -m0=LZMA2 "%pay%\%%~ni.7z" "%pax%\%%i"))>nul 2>nul)else ((for /f "delims=" %%i in ('dir /b/a "%pax%\*"') do (dir/ad "%pax%\%%i" >nul 2>nul&&%~dp0Todo\Rar\Winr.exe a -m5 -s -r -ibck -o+ "%pay%\%%i.rar" -ep1 "%pax%\%%i\"||%~dp0Todo\Rar\Winr.exe a -m5 -s -r -ibck -o+ "%pay%\%%~ni.rar" -ep1 "%pax%\%%i")))
- start "" "%pay%"&set "ercr=压缩文件成功"&goto :soft
-
- :cfile
- ::文件的归档和重命名
- call :callnn 文件操作方式 :soft 2 3 n n 77 88 批量扩展名分类 指定扩展名分类 批量关键字分类 指定关键字分类 按文件时间分类 批量重命名操作
- set bit=%pa%&set pa=<nul&set png=1
- if "%bit%" equ "2" call :callnn 指定扩展名分类 :cfile 0 b n n 77 多个空格区分
- if "%bit%" equ "2" set filex=%pa%
- if "%bit%" equ "3" call :callnn 关键字序号 :cfile 0 b 1 n 77 输入数字
- if "%bit%" equ "3" set /a cnum=%pa% - 1&set pa=<nul
- if "%bit%" equ "3" call :callnn 关键字长度 :cfile 0 b 1 n 77 输入数字
- if "%bit%" equ "3" set clon=%pa%&set pa=<nul
- if "%bit%" equ "4" call :callnn 指定关键字分类 :cfile 0 b n n 77 多个空格区分
- if "%bit%" equ "4" set filex=%pa%
- if "%bit%" equ "5" call :callnn 按文件时间分类 :cfile 2 1 n n 77 88 批量创建时间 指定创建时间 批量访问时间 指定访问时间 批量修改时间 指定修改时间
- if "%bit%" equ "5" set/a str=%pa%,str2=str%%2
- if "%bit%" equ "5" if "%str2%" equ "0" (set biy=2) else (set biy=1)
- if "%bit%" equ "5" if "%pa%" leq "2" (set ctim=c&set cnm=c)else (if "%pa%" leq "4" (set ctim=a&set cnm=a)else (set ctim=w&set cnm=w))
- if "%bit%" equ "5" if "%biy%" equ "2" call :callnn 设置操作时间 :cfile 0 b n n 77 多个时间空格区分
- if "%bit%" equ "5" if "%biy%" equ "2" set timm=%pa%&set pa=<nul
- if "%bit%" equ "6" call :callnn 批量重命名操作 :cfile 2 1 n n 77 88 仅随机数命名 日期加随机数 前缀加随机数 前缀日期随机数
- if "%bit%" equ "6" set biy=%pa%&set pa=<nul&set filez=<nul
- if "%bit%" equ "6" if "%biy%" gtr "2" call :callnn 批量重命名操作 :cfile 0 b n n 77 输入前缀字符
- if "%bit%" equ "6" if "%biy%" gtr "2" set filez=%pa%&set pa=<nul
- call :callnn 文件处理路径 :soft 0 a f n 77 88
- dir/s/b/a-d "%pa%\*">nul 2>nul&&set pax=%pa%&&set pay=%pa%&&set pa=<nul||set "ercr=没有需分类文件"&&goto %bb%
- if "%bit%" lss "6" call :callnn 文件保存路径 :soft 2 1 n n 77 88 默认处理路径 指定保存路径
- :nwtt
- if "%pa%" equ "2" call :callnn 文件保存路径 :cfile 0 a n n 77 88
- if "%pa%" equ "1" (set pay=%pax%)else (if "%pa%" equ "2" (goto :nwtt)else (set pay=%pa%&set pa=<nul))
- setlocal enabledelayedexpansion&set n=0&cls&echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo. 正在操作中......
- if "%bit%" equ "1" (for /f "delims=" %%a in ('dir /b/s/a-d "%pax%\*"') do (md %pay%\%%~xa&move "%%a" %pay%\%%~xa&set /a n=n+1))>nul 2>nul
- if "%bit%" equ "2" (for %%i in (%filex%) do (for /f "delims=" %%a in ('dir /s/b/a-d "%pax%\*.%%i"') do (md %pay%\%%~xa&move "%%a" %pay%\%%~xa&set /a n=n+1)))>nul 2>nul
- if "%bit%" equ "3" (for /f "delims=" %%a in ('dir /s/b/a-d "%pax%\*"') do (set "str=%%~na"&set "pa=!str:~%cnum%,%clon%!"&set "pa=!pa: =!"&md "%pay%\!pa!"&move "%%a" "%pay%\!pa!"&set /a n=n+1))>nul 2>nul
- if "%bit%" equ "4" (for %%i in (%filex%) do (for /f "delims=" %%a in ('dir /s/b/a-d "%pax%\*"') do (echo %%a|findstr /c/i "%%i">nul 2>nul&&set "pa=!pa: =!"&md "%pay%\%%i"&&set /a n=n+1&echo %%a|findstr /c/i "%%i">nul 2>nul&&set "pa=!pa: =!"&&move "%%a" "%pay%\%%i")))>nul 2>nul
- if "%bit%" equ "5" if "%biy%" equ "1" (for /f "delims=" %%i in ('dir /b/s/a-d "%pax%\*"') do (for /f %%a in ('dir /a /t:%ctim% "%%i"^|find "/"') do (set tim=%%a&set tim=!tim:~0,4!!tim:~5,2!!tim:~8,2!&md %pay%\%cnm%!tim!&move "%%i" %pay%\%cnm%!tim!&set /a n=n+1)))>nul 2>nul
- if "%bit%" equ "5" if "%biy%" equ "2" (for %%k in (%timm%) do (for /f "delims=" %%i in ('dir /b/s/a-d/t:%ctim% "%pax%\*"') do (for /f %%a in ('dir /a /t:%ctim% "%%i"^|find "/"') do (set tim=%%a&set tim=!tim:~0,4!!tim:~5,2!!tim:~8,2!&echo !tim!|findstr /c/i "%%k">nul 2>nul&&md %pay%\%cnm%!tim!&echo !tim!|findstr /c/i "%%k">nul 2>nul&&move "%%i" %pay%\%cnm%!tim!&&set /a n=n+1))))>nul 2>nul
- if "%bit%" equ "6" (for /f "delims=" %%i in ('dir /b/s/a-d "%pax%\*"') do (for /f %%a in ('dir /a /t:c "%%i"^|find "/"') do (set tim=%%a&set tim=!tim:~0,4!!tim:~5,2!!tim:~8,2!&set num=!RANDOM:~,3!
- if "%biy%" equ "3" (ren "%%i" %filez%-!num!%%~xi)else (if "%biy%" equ "2" (ren "%%i" !tim!-!num!%%~xi)else (if "%biy%" equ "4" (ren "%%i" %filez%-!tim!-!num!%%~xi)else (ren "%%i" !num!%%~xi)))
- set /a n=n+1)))>nul 2>nul
- if "!n!" gtr "0" (start "" "%pay%"&goto :soft)else (set "ercr=未执行归档或重命名"&goto :soft)
-
- :bchm
- call :callnn CHM反编译 :soft 0 a n chm 77 88
- md %dp%\file\chm&md %dp%\file\temp&del /f/s/q/a %dp%\file\temp\*&cls
- dir/ad "%pa%" >nul 2>nul&&set pat=%pa%||xcopy /y "%pa%" "%dp%\file\temp"&&set pat=%dp%\file\temp
- set ercr=<nul&cls&echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo. 正在反编译中......
- for %%a in ("%pat%\*.chm") do (%~dp0Todo\7z\7z.exe x "%%a" -o"%dp%\file\chm\%%~na"
- (for /f %%i in ('dir/ad/b "%dp%\file\chm\%%~na\$*"') do ( rd /s/q "%dp%\file\chm\%%~na\%%i")&&del /f /s /q "%dp%\file\chm\%%~na\*$*.*"&del /f /s /q "%dp%\file\chm\%%~na\*#*.*"))>nul 2>nul
- start "" %dp%\file\chm&set "ercr=Chm提取成功"&goto :soft
-
- :admckk
- cls&echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo.&echo. 正在添加中......
- (reg delete "HKCR\*\shell\runas" /f
- reg add "HKCR\*\shell\runas" /ve /d "获取超级管理员权限" /f
- reg add "HKCR\*\shell\runas" /v "Icon" /d "C:\Windows\System32\imageres.dll,-78" /f
- reg add "HKCR\*\shell\runas" /v "NoWorkingDirectory" /d "" /f
- reg add "HKCR\*\shell\runas\command" /ve /d "cmd.exe /c takeown /f \"%%1\" && icacls \"%%1\" /grant administrators:F" /f
- reg add "HKCR\*\shell\runas\command" /v "IsolatedCommand" /d "cmd.exe /c takeown /f \"%%1\" && icacls \"%%1\" /grant administrators:F" /f
- reg delete "HKCR\Directory\shell\runas" /f
- reg add "HKCR\Directory\shell\runas" /ve /d "获取超级管理员权限" /f
- reg add "HKCR\Directory\shell\runas" /v "Icon" /d "C:\Windows\System32\imageres.dll,-78" /f
- reg add "HKCR\Directory\shell\runas" /v "NoWorkingDirectory" /d "" /f
- reg add "HKCR\Directory\shell\runas\command" /ve /d "cmd.exe /c takeown /f \"%%1\" /r /d y && icacls \"%%1\" /grant administrators:F /t" /f
- reg add "HKCR\Directory\shell\runas\command" /v "IsolatedCommand" /d "cmd.exe /c takeown /f \"%%1\" /r /d y && icacls \"%%1\" /grant administrators:F /t" /f
- reg delete "HKCR\dllfile\shell" /f
- reg add "HKCR\dllfile\shell\runas" /ve /d "获取超级管理员权限" /f
- reg add "HKCR\dllfile\shell\runas" /v "HasLUAShield" /d "" /f
- reg add "HKCR\dllfile\shell\runas" /v "NoWorkingDirectory" /d "" /f
- reg add "HKCR\dllfile\shell\runas\command" /ve /d "cmd.exe /c takeown /f \"%%1\" && icacls \"%%1\" /grant administrators:F" /f
- reg add "HKCR\dllfile\shell\runas\command" /v "IsolatedCommand" /d "cmd.exe /c takeown /f \"%%1\" && icacls \"%%1\" /grant administrators:F" /f
- reg delete "HKCR\Drive\shell\runas" /f
- reg add "HKCR\Drive\shell\runas" /ve /d "获取超级管理员权限" /f
- reg add "HKCR\Drive\shell\runas" /v "Icon" /d "C:\Windows\System32\imageres.dll,-78" /f
- reg add "HKCR\Drive\shell\runas" /v "NoWorkingDirectory" /d "" /f
- reg add "HKCR\Drive\shell\runas\command" /ve /d "cmd.exe /c takeown /f \"%%1\" /r /d y && icacls \"%%1\" /grant administrators:F /t" /f
- reg add "HKCR\Drive\shell\runas\command" /v "IsolatedCommand" /d "cmd.exe /c takeown /f \"%%1\" /r /d y && icacls \"%%1\" /grant administrators:F /t" /f)>nul 2>nul
- goto :bbs
-
- :quan
- ::quan过来的%1,是要导出到的位置,%2为是否显示,delyy删除制作完成后的原文件
- echo @echo off^&Mode con cols=72 lines=23^&color e^&cd /d %%~dp0^&%%1 %%2>%1
- echo ver^|find "5."^>nul^&^&goto :st^|^|mshta vbscript:createobject("shell.application").shellexecute("%%~s0","goto :st","","runas",%2)(window.close)^&goto :eof>>%1&echo :st>>%1&goto :eof
-
- :cleaner
- call :quan %dp%\clearn.bat 0&setlocal enabledelayedexpansion
- for %%i in (dmp tmp _mp log gid chk old bak query) do (set n=%%i&echo del /f /s /q /a "%%systemdrive%%\*.!n!">>%dp%\clearn.bat)
- for %%i in (pnf InfCache.1) do (set n=%%i&echo del /f /s /q /a "%%SystemRoot%%\inf\*.!n!">>%dp%\clearn.bat)
- for %%i in (pnf InfCache.1) do (set n=%%i&echo del /f /s /q /a "%%SystemRoot%%\Driver Cache\*.!n!">>%dp%\clearn.bat)
- for %%i in (pnf InfCache.1) do (set n=%%i&echo del /f /s /q /a "%%SystemRoot%%\system32\drivers\*.!n!">>%dp%\clearn.bat)
- echo del /f /s /q /a "%%systemdrive%%"\recycled\*.*>>%dp%\clearn.bat
- echo del /f /s /q /a "%%SystemRoot%%\prefetch\*.*">>%dp%\clearn.bat
- echo del /f /s /q /a "%%SystemRoot%%\minidump\*.*">>%dp%\clearn.bat
- echo del /f /s /q /a "%%userprofile%%\local settings\temp\*.*">>%dp%\clearn.bat
- echo del /f /s /q /a "%%userprofile%%\Locals~1\Tempor~1\*.*">>%dp%\clearn.bat
- echo del /f /s /q /a "%%userprofile%%\Locals~1\Temp\*.*">>%dp%\clearn.bat
- echo del /f /s /q /a "%%userprofile%%\recent\*.*">>%dp%\clearn.bat
- echo del /f /s /q /a "%%HomePath%%\..\IconCache.db">>%dp%\clearn.bat
- echo del /f /s /q /a "%%userprofile%%\cookies\*.*">>%dp%\clearn.bat
- echo del /f /s /q /a "%%userprofile%%\local settings\temporary internet files\*.*">>%dp%\clearn.bat
- echo rd /s /q "%%SystemRoot%%\Downloaded Program Files">>%dp%\clearn.bat
- echo rd /s /q "%%SystemRoot%%\Offline Web Pages">>%dp%\clearn.bat
- echo rd /s /q "%%SystemRoot%%\Connection Wizard">>%dp%\clearn.bat
- echo rd /s /q "%%SystemRoot%%\SoftwareDistribution\Download">>%dp%\clearn.bat
- echo rd /s /q "%%SystemRoot%%\Assembly">>%dp%\clearn.bat
- echo rd /s /q "%%SystemRoot%%\Help">>%dp%\clearn.bat
- echo rd /s /q "%%SystemRoot%%\system32\ReinstallBackups">>%dp%\clearn.bat
- echo rd /s /q "%%SystemRoot%%\temp" ^& md "%%SystemRoot%%\temp">>%dp%\clearn.bat
- echo rd /s /q "%%SystemRoot%%\$hf_mig$">>%dp%\clearn.bat
- echo dir "%%SystemRoot%%\$NtUninstall*" /a:d /b ^>%%temp%%\update.txt>>%dp%\clearn.bat
- echo for /f %%%%i in (%%temp%%\update.txt) do (rd %%SystemRoot%%\%%%%i /s /q )>>%dp%\clearn.bat
- echo dir "%%SystemRoot%%\inf\*.*" /ad/b ^>%%temp%%\vTmp.txt >>%dp%\clearn.bat
- echo for /f %%%%a in (%%temp%%\vTmp.txt) do ( rd /s /q "%%SystemRoot%%\inf\%%%%a")>>%dp%\clearn.bat
- echo dir "%%SystemDrive%%\found.???" /ad/b ^>%%temp%%\vTmp.txt >>%dp%\clearn.bat
- echo for /f %%%%a in (%%temp%%\vTmp.txt) do ( rd /s /q "%%SystemDrive%%\inf\%%%%a")>>%dp%\clearn.bat
- echo dir "%%SystemRoot%%\$*$" /ad/b ^>%%temp%%\vTmp.txt>>%dp%\clearn.bat
- echo for /f %%%%a in (%%temp%%\vTmp.txt) do ( rd /s /q "%%SystemRoot%%\%%%%a")>>%dp%\clearn.bat
- echo cd..^&for /f "delims=" %%%%a in ('dir/ad/b "%%temp%%"') do ( rd /s/q "%%temp%%\%%%%a")^&del /s/f/q/a %%temp%%\*>>%dp%\clearn.bat
- echo cd..^&for /f "delims=" %%%%a in ('dir/ad/b "%%tmp%%"') do ( rd /s/q "%%tmp%%\%%%%a")^&del /s/f/q/a %%tmp%%\*>>%dp%\clearn.bat
- echo exit /b>>%dp%\clearn.bat
- call %dp%\clearn.bat&goto :soft
复制代码
作者: chenlugen 时间: 2018-11-2 22:52
厉害了,我滴哥!!!!
作者: /zhqsystem/zhq 时间: 2018-11-2 23:09
留个楼备用没准哪天用到
作者: 523066680 时间: 2018-11-3 10:44
看起来好厉害的样子
作者: holley 时间: 2018-11-4 13:17
有点晕,不明觉厉!
作者: Taurus 时间: 2018-11-6 00:12
好像應該貼到這區保留
http://www.bathome.net/forum-6-1.html
作者: 极品小猫 时间: 2018-11-6 09:35
厉害了我的哥,你真有精力。
都写到一个批处理里是个大工程,维护困难繁琐,还是分文件 Call 调用好一点吧
欢迎光临 批处理之家 (http://bathome.net./) |
Powered by Discuz! 7.2 |