------------先扔代码,再废话。。。。。- @echo off
- Set "zm=HKEY_CLASSES_ROOT\DesktopBackground\shell\zm"
- Set "zms=%zm%\Shell"
- Set "R=Call;:RZMY"
- %R% "%zm%" "我的设置" "SHELL32.dll,-022" "0" "1"
- %R% "%zms%\1" " 注册表" "regedit.exe" "regedit"
- %R% "%zms%\2" " 组策略" "gpedit.dll,0" "mmc gpedit.msc"
- %R% "%zms%\3" " 计算器" "win32calc.exe" "calc"
- %R% "%zms%\4" "桌面图标" "SHELL32.dll,34" "rundll32 shell32.dll,Control_RunDLL desk.cpl,,0" "1"
- %R% "%zms%\5" "控制面板" "control.exe" "control.exe"
- %R% "%zms%\6" "程序卸载" "OptionalFeatures.exe" "rundll32.exe shell32.dll,Control_RunDLL appwiz.cpl"
- %R% "%zms%\7" "系统服务" "filemgmt.dll,0" "MMC services.msc" "1"
- %R% "%zms%\8" "桌面截频" "shell32.dll,238" "explorer ms-screenclip:"
- %R% "%zms%\9" "系统版本" "shell32.dll,277" "winver.exe"
- exit
- :RZMY
- if not "%~2"=="" Reg add "%~1" /f /v "MUIVerb" /t REG_SZ /d "%~2"
- if not "%~3"=="" Reg add "%~1" /f /v "Icon" /t REG_SZ /d "%~3"
- if "%~4"=="0" (Reg add "%~1" /f /v "SubCommands"
- if "%~5"=="0" Reg add "%~1" /f /v "Position" /t REG_SZ /d "top"
- if "%~5"=="1" Reg add "%~1" /f /v "Position" /t REG_SZ /d "Bottom" ) else (
- if not "%~4"=="0" Reg add "%~1\Command" /f /ve /t REG_SZ /d "%~4")
- if "%~5"=="1" Reg add "%~1" /f /v "CommandFlags" /t REG_DWORD /d "32"
- Goto;:Eof
复制代码 代码存 ANSI 编码,XXX.BAT,,,
--------脚本卸载命令,,,- Reg delete "HKEY_CLASSES_ROOT\DesktopBackground\shell\zm" /f
复制代码 --------------------------废话开始!
前段时间 鄙人不是一直在研究注册表嘛! 小有所成,,,
写了很多,奇奇怪怪,各种各样的的注册表设置和命令,,,
这里只是贴出一小部分,,,其他的没什么值得说,,,
命令行 REG ,的写法,基本都是 一行一命令,一行一写法,,
而象我这个注册表的完整写法 应该是,
一命令项 最少要写两行。
名称 一行。。
执行命令 一行
图标 一行 ,,可省略,,,
完整的注册表 最少要
所以我这写法是把 该有的写法 集合在一个 调用 标签里,,,
采用参数调度,,,一行命令 搞定,,,
这是脚本的一种写法,写法不难,命令组合也不难,而是这类思路比较少有人发表,,,,
所以呢,抛砖引玉,,,抛这注册表,引这类写法,,,,给新人一些借鉴吧,,
也希望大神门不要藏卓,出来讨论一吓呗,毕竟现在很多脚本,都没什么人讨论了,,都去找 A1了,,, |