Thanks, Dias.
More question.
How can i insert a string in the end of a file without entering a new line.
needaddcata.txt41006200730065006E0063006500
43007500730074006F006D0065007200
4D00610069006E00740065006E0061006E0063006500
4F007400680065007200
520026004400
54007200610069006E0069006E006700
My code:
@echo off
setlocal enabledelayedexpansion
for /f "tokens=3 delims= " %%i in ('reg query hkcu\software\microsoft\office\11.0\outlook\categories') do @echo %%i > temp.txt
for /f %%i in (needaddcata.txt) do (
findstr /c:"%%i" temp.txt > nul
if !errorlevel!==1 echo %%i >> temp.txt
)
After my code run, the output file content:
temp.txt730074006F006D00650072003B004D006100690
06E00740065006E0061006E00630065003B004D
0069007300630065006C006C0061006E0065006
F00750073003B004F0074006800650072003B00
50006500720073006F006E0061006C003B00500
068006F006E0065002000430061006C006C0073
003B005200260044003B0053007400610074007
50073003B005300740072006100740065006700
6900650073003B0053007500700070006C00690
06500720073003B00540069006D006500200026
00200045007800700065006E007300650073003
B0054007200610069006E0069006E0067003B00
5600490050003B00570061006900740069006E0
067003B000000
41006200730065006E0063006500
43007500730074006F006D0065007200
And if the output file was OK, how do i add that content in registry? because its require a hex.
reg add hkcu\software\microsoft\office\11.0\outlook\categories /v MasterList /t REG_BINARY /d " "
My script try to add some categories into MS Outlook "master category list". it just only add the missing category
Make sure you backup for registry before doing anything.