标题: [注册表类] 批处理Reg命令怎样添加大数据?谢谢! [打印本页]
作者: Shuye 时间: 2024-2-20 03:26 标题: 批处理Reg命令怎样添加大数据?谢谢!
太大,分2贴:- @ Echo Off
- SetLocal EnableDelayedExpansion
-
- Set Data=00560100003A001F80C827341F105C1042AA032EE45287D668260001002600EFBE12000000C99A34EAAC5EDA01A4B1E1
- Set Data=!Data!CCAD5EDA01BE9D17CDAD5EDA01140056003100000000004D58919610005461736B42617200400009000400EFBE4D5891
- Set Data=!Data!964D5891962E0000002652000000000200000000000000000000000000000042E7F2005400610073006B004200610072
- Set Data=!Data!0000001600C40032007C0900004D582C9220004D4943524F537E312E4C4E4B0000560009000400EFBE4D5891964D5891
- Set Data=!Data!962E00000028520000000002000000000000000000000000000000E1CBC5004D006900630072006F0073006F00660074
- Set Data=!Data!00200045006400670065002E006C006E006B0000001C00120000002B00EFBE0D001ACDAD5EDA011C001A0000001D00EF
- Set Data=!Data!BE02004D005300450064006700650000001C00260000001E00EFBE0200530079007300740065006D00500069006E006E
- Set Data=!Data!006500640000001C00000000A40100003A001F80C827341F105C1042AA032EE45287D668260001002600EFBE12000000
- Set Data=!Data!C99A34EAAC5EDA01A4B1E1CCAD5EDA01468923CDAD5EDA01140056003100000000004D58919611005461736B42617200
- Set Data=!Data!400009000400EFBE4D5891964D5891962E00000026520000000002000000000000000000000000000000BAFBE6005400
- Set Data=!Data!610073006B00420061007200000016001201320097010000874F0749200046494C4545587E312E4C4E4B00007C000900
- Set Data=!Data!0400EFBE4D5891964D5891962E00000029520000000002000000000000000000520000000000589C4400460069006C00
- Set Data=!Data!650020004500780070006C006F007200650072002E006C006E006B00000040007300680065006C006C00330032002E00
- Set Data=!Data!64006C006C002C002D003200320030003600370000001C00120000002B00EFBE468923CDAD5EDA011C00420000001D00
- Set Data=!Data!EFBE02004D006900630072006F0073006F00660074002E00570069006E0064006F00770073002E004500780070006C00
- Set Data=!Data!6F0072006500720000001C00260000001E00EFBE0200530079007300740065006D00500069006E006E00650064000000
- Set Data=!Data!1C000000004B06000014001F809BD434424502F34DB7803893943456E135060000990541505053870508000300000000
- Set Data=!Data!0000004E0200003153505355284C9F799F394BA8D0E1D42DE1D5F35D00000011000000001F000000250000004D006900
- Set Data=!Data!630072006F0073006F00660074002E00570069006E0064006F0077007300530074006F00720065005F00380077006500
- Set Data=!Data!6B0079006200330064003800620062007700650000000000110000000E00000000130000000100000085000000150000
- Set Data=!Data!00001F000000390000004D006900630072006F0073006F00660074002E00570069006E0064006F007700730053007400
- Set Data=!Data!6F00720065005F00310031003900310030002E0031003000300032002E0035002E0030005F007800360034005F005F00
- Set Data=!Data!3800770065006B00790062003300640038006200620077006500000000006500000005000000001F000000290000004D
- Set Data=!Data!006900630072006F0073006F00660074002E00570069006E0064006F0077007300530074006F00720065005F00380077
- Set Data=!Data!0065006B00790062003300640038006200620077006500210041007000700000000000BD0000000F000000001F000000
- Set Data=!Data!5600000043003A005C00500072006F006700720061006D002000460069006C00650073005C00570069006E0064006F00
- Set Data=!Data!7700730041007000700073005C004D006900630072006F0073006F00660074002E00570069006E0064006F0077007300
- Set Data=!Data!530074006F00720065005F00310031003900310030002E0031003000300032002E0035002E0030005F00780036003400
- Set Data=!Data!5F005F003800770065006B0079006200330064003800620062007700650000001D000000200000000048000000CBA308
- Set Data=!Data!626D9DBC46B8F7D130A998CBE9000000008A020000315350534D0BD48669903C44819A2A54090DCCEC550000000C0000
- Set Data=!Data!00001F000000210000004100730073006500740073005C00410070007000540069006C00650073005C00530074006F00
- Set Data=!Data!720065004D0065006400540069006C0065002E0070006E006700000000005500000002000000001F0000002100000041
- Set Data=!Data!00730073006500740073005C00410070007000540069006C00650073005C00530074006F00720065004100700070004C
- Set Data=!Data!006900730074002E0070006E00670000000000590000000F000000001F00000023000000410073007300650074007300
- Set Data=!Data!5C00410070007000540069006C00650073005C00530074006F0072006500420061006400670065004C006F0067006F00
- Set Data=!Data!2E0070006E00670000000000550000000D000000001F000000220000004100730073006500740073005C004100700070
- Set Data=!Data!00540069006C00650073005C00530074006F00720065005700690064006500540069006C0065002E0070006E00670000
- Set Data=!Data!00110000000400000000130000000078D7FF5900000013000000001F000000230000004100730073006500740073005C
- Set Data=!Data!00410070007000540069006C00650073005C00530074006F00720065004C006100720067006500540069006C0065002E
- Set Data=!Data!0070006E0067000000000011000000050000000013000000FFFFFFFF110000000E0000000013000000A5040000310000
- Set Data=!Data!000B000000001F000000100000004D006900630072006F0073006F00660074002000530074006F007200650000005900
- Set Data=!Data!000014000000001F000000230000004100730073006500740073005C00410070007000540069006C00650073005C0053
- Set Data=!Data!0074006F007200650053006D0061006C006C00540069006C0065002E0070006E00670000000000000000003100000031
- Set Data=!Data!535053B1166D44AD8D7048A748402EA43D788C150000006400000000150000000B01000000000000000000004D000000
- Set Data=!Data!3153505330F125B7EF471A10A5F102608C9EEBAC310000000A000000001F000000100000004D006900630072006F0073
- Set Data=!Data!006F00660074002000530074006F00720065000000000000002D00000031535053B377ED0D14C66C45AE5B285B38D7B0
复制代码
转下帖
作者: Shuye 时间: 2024-2-20 03:27
接上贴- Set Data=!Data!1B110000000700000000130000000000000000000000000000000000120000002B00EFBE94EB25CDAD5EDA019F055E00
- Set Data=!Data!00001D00EFBE02004D006900630072006F0073006F00660074002E00570069006E0064006F0077007300530074006F00
- Set Data=!Data!720065005F003800770065006B00790062003300640038006200620077006500210041007000700000009F0526000000
- Set Data=!Data!1E00EFBE0200530079007300740065006D00500069006E006E006500640000009F05000000A706000014001F809BD434
- Set Data=!Data!424502F34DB7803893943456E191060000AD05415050539B0508000300000000000000F60200003153505355284C9F79
- Set Data=!Data!9F394BA8D0E1D42DE1D5F37500000011000000001F000000320000006D006900630072006F0073006F00660074002E00
- Set Data=!Data!770069006E0064006F007700730063006F006D006D0075006E00690063006100740069006F006E007300610070007000
- Set Data=!Data!73005F003800770065006B007900620033006400380062006200770065000000110000000E0000000013000000010000
- Set Data=!Data!00A900000015000000001F0000004B0000006D006900630072006F0073006F00660074002E00770069006E0064006F00
- Set Data=!Data!7700730063006F006D006D0075006E00690063006100740069006F006E00730061007000700073005F00310036003000
- Set Data=!Data!300035002E00310031003600320039002E00320030003300310036002E0030005F007800360034005F005F0038007700
- Set Data=!Data!65006B0079006200330064003800620062007700650000000000AD00000005000000001F0000004D0000006D00690063
- Set Data=!Data!0072006F0073006F00660074002E00770069006E0064006F007700730063006F006D006D0075006E0069006300610074
- Set Data=!Data!0069006F006E00730061007000700073005F003800770065006B0079006200330064003800620062007700650021006D
- Set Data=!Data!006900630072006F0073006F00660074002E00770069006E0064006F00770073006C006900760065002E006D00610069
- Set Data=!Data!006C0000000000E10000000F000000001F0000006800000043003A005C00500072006F006700720061006D0020004600
- Set Data=!Data!69006C00650073005C00570069006E0064006F007700730041007000700073005C006D006900630072006F0073006F00
- Set Data=!Data!660074002E00770069006E0064006F007700730063006F006D006D0075006E00690063006100740069006F006E007300
- Set Data=!Data!61007000700073005F00310036003000300035002E00310031003600320039002E00320030003300310036002E003000
- Set Data=!Data!5F007800360034005F005F003800770065006B0079006200330064003800620062007700650000001D00000020000000
- Set Data=!Data!004800000092B4188E50E91243869297EB876D6437000000000E020000315350534D0BD48669903C44819A2A54090DCC
- Set Data=!Data!EC490000000C000000001F0000001C00000069006D0061006700650073005C00480078004D00610069006C004D006500
- Set Data=!Data!6400690075006D00540069006C0065002E0070006E00670000004500000002000000001F0000001900000069006D0061
- Set Data=!Data!006700650073005C00480078004D00610069006C004100700070004C006900730074002E0070006E0067000000000041
- Set Data=!Data!0000000F000000001F0000001700000069006D0061006700650073005C00480078004D00610069006C00420061006400
- Set Data=!Data!670065002E0070006E00670000000000450000000D000000001F0000001A00000069006D0061006700650073005C0048
- Set Data=!Data!0078004D00610069006C005700690064006500540069006C0065002E0070006E00670000001100000004000000001300
- Set Data=!Data!00000078D7FF4900000013000000001F0000001B00000069006D0061006700650073005C00480078004D00610069006C
- Set Data=!Data!004C006100720067006500540069006C0065002E0070006E0067000000000011000000050000000013000000FFFFFFFF
- Set Data=!Data!110000000E0000000013000000AD040000190000000B000000001F00000003000000AE90F64E00000000490000001400
- Set Data=!Data!0000001F0000001B00000069006D0061006700650073005C00480078004D00610069006C0053006D0061006C006C0054
- Set Data=!Data!0069006C0065002E0070006E00670000000000000000003100000031535053B1166D44AD8D7048A748402EA43D788C15
- Set Data=!Data!000000640000000015000000F20000000000000000000000350000003153505330F125B7EF471A10A5F102608C9EEBAC
- Set Data=!Data!190000000A000000001F00000003000000AE90F64E00000000000000002D00000031535053B377ED0D14C66C45AE5B28
- Set Data=!Data!5B38D7B01B110000000700000000130000000000000000000000000000000000120000002B00EFBE8215B0CCAD5EDA01
- Set Data=!Data!B305A60000001D00EFBE02006D006900630072006F0073006F00660074002E00770069006E0064006F00770073006300
- Set Data=!Data!6F006D006D0075006E00690063006100740069006F006E00730061007000700073005F003800770065006B0079006200
- Set Data=!Data!330064003800620062007700650021006D006900630072006F0073006F00660074002E00770069006E0064006F007700
- Set Data=!Data!73006C006900760065002E006D00610069006C000000B305260000001E00EFBE0200530079007300740065006D005000
- Set Data=!Data!69006E006E00650064000000B3050000FF
-
- Reg Add HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Taskband /v Favorites /t Reg_Binary /d !Data! /f
- Pause
复制代码
添加不成功,注册表没修改。
但是,删除任意三行Data数据后,添加成功,注册表已修改。
是不是数据太大,怎样解决?
请大师指点,谢谢啦!
作者: Shuye 时间: 2024-2-20 03:31
本帖最后由 Shuye 于 2024-2-20 03:35 编辑
如果做成 *.reg 文件
"Favorites"=hex:......
也导入成功。
就是 Reg Add ...... 没法弄。
请大师指点,谢谢!
作者: Shuye 时间: 2024-2-20 03:44
会不会是 Set 的问题?
作者: Shuye 时间: 2024-2-20 04:35
能不能分两次添加、再拼接起来?
作者: czjt1234 时间: 2024-2-20 08:33
本帖最后由 czjt1234 于 2024-2-20 08:35 编辑
删除任意三行Data数据后,添加成功
应该可以认为这是 add 天生的限制
试了vbs可以- '示例:用WMI写入多字节的REG_BINARY二进制数据
- Dim oWshShell, oREG, s
-
- Const HKCU = &H80000001
-
- Set oWshShell = CreateObject("WScript.Shell")
- Set oREG = GetObject("Winmgmts:\\.\Root\Default:StdRegProv")
- oWshShell.RegWrite "HKCU\SOFTWARE\test\", "", "REG_SZ"
-
- With CreateObject("Msxml2.DOMDocument").CreateElement("binary")
- .DataType = "bin.hex"
- .Text = "320A31DF37350038" '16进制字节值
- s = .NodeTypedValue
- End With
- oREG.SetBinaryValue HKCU, "SOFTWARE\test", "e", s
-
- MsgBox "ok"
复制代码
用你第一行的数据复制粘贴了90次,测试通过
作者: czjt1234 时间: 2024-2-20 08:39
非要批处理的话可以这样- rem 另存为 ANSI 编码
- ' & cls & cscript.exe /nologo /e:vbscript "%~f0" %* & pause & exit /b
-
- Dim oWshShell, oREG, s
-
- Const HKCU = &H80000001
-
- Set oWshShell = CreateObject("WScript.Shell")
- Set oREG = GetObject("Winmgmts:\\.\Root\Default:StdRegProv")
- oWshShell.RegWrite "HKCU\SOFTWARE\test\", "", "REG_SZ"
-
- With CreateObject("Msxml2.DOMDocument").CreateElement("binary")
- .DataType = "bin.hex"
- .Text = "320A31DF37350038" '16进制字节值
- s = .NodeTypedValue
- End With
- oREG.SetBinaryValue HKCU, "SOFTWARE\test", "e", s
复制代码
作者: Batcher 时间: 2024-2-20 08:44
回复 2# Shuye
批处理允许定义的变量上限
http://bbs.bathome.net/thread-3403-1-1.html#pid21404
作者: qixiaobin0715 时间: 2024-2-21 10:23
回复 5# Shuye
拼接一下试试:
1.把1楼所有“Set Data=!Data!”修改为“Set Data1=!Data1!”;
2.把2楼所有“Set Data=!Data!”修改为“Set Data2=!Data2!”;
3.把2楼Reg Add那一行中的!Data!修改为“!Data1!!Data2!”
作者: Shuye 时间: 2024-2-22 03:24
谢谢czjt1234兄、Batcher兄、qixiaobin0715兄!
欢迎光临 批处理之家 (http://www.bathome.net/) |
Powered by Discuz! 7.2 |