|
|
谢谢大佬 我修改了一下,转成CMD文件
- @ECHO OFF
- CLS
- color 1f
- SET SOFTNAME=Notepad++
- SET EXETP=%CD%\notepad++.exe
- SET ICONTP=%CD%\notepad++.exe,0
- SET REG_VAR=notepad++
- SET YJMC=使用"Notepad++"打开
- rem YJMC=使用"Notepad++"打开 (&B) 只显示(前面内容
- Title %SOFTNAME%
- :menu
- cls
- echo.
- echo %SOFTNAME% 主菜单
- echo ==========================
- echo.
- echo 1、添加右键菜单
- echo.
- echo 0、删除右键菜单
- echo.
- echo.
- :cl
- echo.
- set /p choice= 请选择要进行的操作,然后按回车:
- IF NOT "%choice%"=="" SET choice=%choice:~0,1%
- if /i "%choice%"=="0" goto s0
- if /i "%choice%"=="1" goto s1
- echo.
- echo 选择无效,请重新输入
- echo.
- goto cl
- :s1
- reg add "HKLM\SOFTWARE\Classes\*\shell\%REG_VAR%" /f /v "Icon" /t REG_SZ /d "%ICONTP%"
- reg add "HKLM\SOFTWARE\Classes\*\shell\%REG_VAR%" /f /ve /t REG_SZ /d "%YJMC%"
- reg add "HKLM\SOFTWARE\Classes\*\shell\%REG_VAR%\command" /f /ve /t REG_SZ /d ""%EXETP%" "%%1""
- reg add "HKCR\*\shell\%REG_VAR%" /f /v "Icon" /t REG_SZ /d "%ICONTP%"
- reg add "HKCR\*\shell\%REG_VAR%" /f /ve /t REG_SZ /d "%YJMC%"
- reg add "HKCR\*\shell\%REG_VAR%\command" /f /ve /t REG_SZ /d ""%EXETP%" "%%1""
- echo ...........................
- echo.
- echo.
- echo 操作成功按任意键
- echo.
- echo.
- echo ...........................
- pause >nul
- goto _exit
- :s0
- reg delete "HKCR\*\shell\%REG_VAR%" /f
- reg delete "HKLM\SOFTWARE\Classes\*\shell\%REG_VAR%" /f
- echo ...........................
- echo.
- echo.
- echo 操作成功按任意键
- echo.
- echo.
- echo ...........................
- pause >nul
- goto _exit
- :_exit
- exit
- rem if /i %PROCESSOR_IDENTIFIER:~0,3% neq x86 goto _64
- rem :_86
- rem reg delete "HKCR\*\shell\用"记事本"打开" /f
- rem goto _wc1
- rem :_64
- rem reg delete "HKCR\*\shell\用"记事本"打开" /f
- rem :_wc1
复制代码
|
|