|
论坛里有这个批处理。搜PETOOL就出来了 很多
贴 一个
PETOOLS.INI 由PECMD调用
- TIPS 加载PETOOLS工具,到开始菜单...,3000,1,#1
- FORX *ab @\PETOOLS,TOOLS,0,EXEC !%Windir%\SYSTEM32\PETOOLS.cmd %TOOLS%
复制代码
PETOOLS.CMD 可以把指定目录下包括子目录下的外置程序添加到菜单和桌面
- @echo off
- if "%~1"=="" goto :eof
- if not defined StartMenu goto :eof
- if "%~1"=="merge" goto :merge
- if not exist "%~1" goto :eof
- SET "BASE_DIR=%~1"
- SET "外置程序=%~d1盘_外置程序"
- SET "外置程序=%StartMenu%\%外置程序::=%"
- CALL,SET "附到桌面=%%外置程序:%StartMenu%=%Desktop%%%"
- SET "_TF=%WinDir%\T_PETOOLS_%base_dir:~0,1%_"
- IF EXIST "%外置程序%" RD /S /Q "%外置程序%" 2>nul
- IF EXIST "%附到桌面%" RD /S /Q "%附到桌面%" 2>nul
- :START
- DEL "%_TF%*.*" 2>nul
- PUSHD "%~F1"
- >%_TF%LST.lst dir /s/a/b *.wim *.cmd *.bat *.exe readme*.txt 使用说明*.txt
- POPD
- PUSHD "%WinDir%"
- for /f "usebackq delims=" %%i in (%_TF%LST.lst) do CALL :MAKE_LINK "%%i"
- ECHO.EXEC !%~F0 merge "%外置程序%" >>%_TF%LNK.INI
- ECHO.EXEC !%~F0 merge "%附到桌面%" >>%_TF%LNK.INI
- ECHO.FILE %_TF%LNK.INI>>%_TF%LNK.INI
- START PECMD LOAD %_TF%LNK.INI
- PUSHD "%~F1"
- >"%_TF%SETUP.lst" dir /s/a/b setup.cmd 2>nul
- >>"%_TF%SETUP.lst" dir /s/a/b setup.bat 2>nul
- POPD
- if exist "%_TF%SETUP.lst" For /f "delims=" %%i in ('type "%_TF%SETUP.lst"') do CALL :PETOOLS_REG %%i
- DEL %_TF%*.lst
- POPD
- goto :eof
- :MAKE_LINK
- SETLOCAL
- if "%~1"=="" goto :eof
- if /i "%~n1"=="setup" goto :eof
- SET ".=%~1"
- SET ".=%.:&=^&%"
- SET "PETOOLS=%~dpn1"
- call,SET "PETOOLS=%%PETOOLS:%BASE_DIR%=%外置程序%%%"
- SET "PETOOLS=%PETOOLS:&=^&%"
- echo.LINK %PETOOLS%,%.%>>%_TF%LNK.INI
- call,SET "PETOOLS=%%PETOOLS:%外置程序%=%附到桌面%%%"
- echo.LINK %PETOOLS%,%.%>>%_TF%LNK.INI
- GOTO :EOF
- :PETOOLS_REG
- pushd "%~dp1"
- PECMD EXEC !%~nx1
- POPD
- goto :eof
- :merge
- PUSHD %2||GOTO :EOF
- for /d %%i in ("%~2\*") do call :merge_lnk "%%i"
- POPD
- goto :eof
- :merge_lnk
- CD /D %1||GOTO :EOF
- for /d %%i in ("%~f1\*") do call %0 "%%i"
- CD /D %1||GOTO :EOF
- set n=
- for /f %%i in ('dir /a/b') do (
- if defined n goto :eof
- set n=1
- )
- for /f "usebackq delims=" %%i in (`dir /a/b`) do move /y "%%i" ..\
- cd..&&rd %1
- goto :eof
复制代码 |
评分
-
查看全部评分
|