|
|
- ========================================================================
- 图标提取 v2.1 --By smss 更新:https://pecmd.net/thread-1353.htm
- ========================================================================
- 用法:IcoE.exe <命令> [文件] <索引> [输出路径]
- 选项:(无参数)、-h、-? 帮助
- -v 读取版本信息
- -e [文件] 0 全提取到对应"程序名"文件夹,命名方式:图标名.ico
- -e [文件] 0 [输出路径] 全提取到指定路径,命名方式:图标名.ico
- -x [文件] 0 同上,命名方式:序号_图标名.ico
- -x [文件] 0 [输出路径] 同上,命名方式:序号_图标名.ico
- 参数说明:
- 文件 包含图标的文件路径 (如 Exe、Dll、Sfx、Ime、Icl)
- 索引 0=所有图标;正数=从头计数;负数=从尾计数
- 路径 文件夹路径(全量提取)或文件路径(单个提取)
- ------------------------------------------------------------------------
- 错误代码:
- %errorlevel% = 0 : 执行成功
- %errorlevel% = -1 : 参数错误
- %errorlevel% = -2 : 找不到文件
- %errorlevel% = -3 : 资源错误(索引无效/无法加载)
- ------------------------------------------------------------------------
- 示例:
- 1. IcoE.exe <文件> 提取首个图标到程序所在目录
- 2. IcoE.exe <文件> <索引> 返回指定图标的名称(索引≠0)
- 3. IcoE.exe <文件> 0 返回所有图标的名称
- 4. IcoE.exe <文件> <索引> <路径> 提取单个图标到指定路径(索引≠0)
- ------------------------------------------------------------------------
- 全提取: 命名:程序名_序号_图标名.ico
- 5. IcoE.exe <文件> 0 <路径> 提取所有图标到指定路径文件夹
- -e 模式: 命名:图标名.ico
- 6. IcoE.exe -e <文件> 0 提取所有图标到对应"程序名"文件夹
- 7. IcoE.exe -e <文件> 0 <路径> 提取所有图标到指定路径文件夹
- -x 模式: 命名:序号_图标名.ico
- 8. IcoE.exe -x <文件> 0 提取所有图标到对应"程序名"文件夹
- 9. IcoE.exe -x <文件> 0 <路径> 提取所有图标到指定路径文件夹
- ------------------------------------------------------------------------
- IcoE.exe -v C:\Windows\explorer.exe 读取版本信息
- IcoE.exe C:\Windows\explorer.exe 1 1.ico 提取正数第1个图标
- IcoE.exe C:\Windows\explorer.exe 6 返回第6个图标的名称
- ========================================================================
复制代码- @Echo off&::以管理员权限运行,关联至右键,再次运行则删除
- reg delete "HKCR\SystemFileAssociations\.exe\shell\提取首个图标" /f >nul 2>&1
- if %errorlevel%==1 (
- for %%i in (exe dll ocx cpl sfx ime icl)do (
- reg add "HKCR\SystemFileAssociations\.%%i\shell\提取首个图标" /v "Icon" /t REG_SZ /d "shell32.dll,43" /f
- reg add "HKCR\SystemFileAssociations\.%%i\shell\提取首个图标\command" /ve /t REG_SZ /d ""%~dp0IcoE.exe" %%1" /f
- reg add "HKCR\SystemFileAssociations\.%%i\shell\提取所有图标" /v "Icon" /t REG_SZ /d "shell32.dll,43" /f
- reg add "HKCR\SystemFileAssociations\.%%i\shell\提取所有图标\command" /ve /t REG_SZ /d ""%~dp0IcoE.exe" -x %%1 0" /f
- )>nul
- echo 添加成功
- )else (
- for %%i in (exe dll ocx cpl sfx ime icl)do (
- if '%%i' neq 'exe' reg delete "HKCR\SystemFileAssociations\.%%i\shell\提取首个图标" /f
- reg delete "HKCR\SystemFileAssociations\.%%i\shell\提取所有图标" /f
- )>nul
- echo 删除成功
- )
- pause
复制代码- ::批量提取当前目录下所有程序 所有图标至相对应文件夹
- for /r %%i in (*.exe)do IcoE.exe "%%i" 0 "%%~ni"
复制代码
|
|