Board logo

标题: [注册表类] 右键添加使用Notepad++打开带图标 [打印本页]

作者: smss    时间: 2020-2-3 16:08     标题: 右键添加使用Notepad++打开带图标

本帖最后由 smss 于 2021-4-3 13:11 编辑
  1. @Echo Off
  2. for %%a in (D C E F G H I J K L M N O P Q R S T U V W X Y Z)do if exist %%a:\ pushd %%a:\&for /r %%b in (*notepad++.exe)do set Y=%%b&goto A
  3. :A
  4. reg query "HKCR\*\shell\Notepad++" >nul 2>nul&&(reg delete "HKCR\*\shell\NotePad++" /f&echo 已删除)||(reg add "HKCR\*\shell\Notepad++" /t REG_SZ /d 使用Notepad++打开 /f&reg add "HKCR\*\shell\Notepad++" /v Icon /t REG_SZ /d %Y% /f&reg add "HKCR\*\shell\Notepad++\Command" /t REG_SZ /d "\"%Y%\" "\"%%1\" /f&echo 已添加)
  5. ping 0 -n "2">nul
复制代码

作者: flashercs    时间: 2020-2-3 16:40

  1. @Echo Off&SetLocal EnableDelayedExpansion
  2. reg query "HKEY_CLASSES_ROOT\*\shell\Notepad++" >nul 2>nul&&set X=删除&&Goto B||set X=添加&&Goto A
  3. :A
  4. title %X%右键使用Notepad++打开
  5. reg add "HKEY_CLASSES_ROOT\*\shell\Notepad++" /t REG_SZ /d "使用Notepad++打开" /f>nul
  6. reg add "HKEY_CLASSES_ROOT\*\shell\Notepad++" /v Icon /t REG_SZ /d "D:\软件\Notepad++\Notepad++.exe" /f>nul
  7. reg add "HKEY_CLASSES_ROOT\*\shell\Notepad++\Command" /t REG_SZ /d "\"D:\软件\Notepad++\Notepad++.exe\" \"%%1\"" /f>nul
  8. reg add "HKEY_CLASSES_ROOT\Directory\shell\Notepad++" /t REG_SZ /d "使用Notepad++打开" /f>nul
  9. reg add "HKEY_CLASSES_ROOT\Directory\shell\Notepad++" /v Icon /t REG_SZ /d "D:\软件\Notepad++\Notepad++.exe" /f>nul
  10. reg add "HKEY_CLASSES_ROOT\Directory\shell\Notepad++\Command" /t REG_SZ /d "\"D:\软件\Notepad++\Notepad++.exe\" \"%%1\"" /f>nul
  11. Goto C
  12. :B
  13. title %X%右键使用Notepad++打开
  14. reg delete "HKEY_CLASSES_ROOT\*\shell\NotePad++" /f >nul
  15. reg delete "HKEY_CLASSES_ROOT\Directory\shell\Notepad++" /f >nul
  16. Goto C
  17. :C
  18. echo 已成功%X%右键使用Notepad++打开
  19. ping 0 -n "2">nul
复制代码





欢迎光临 批处理之家 (http://www.bathome.net/) Powered by Discuz! 7.2