1.

Solve : add reg data through a batch file instead of a .reg file?

Answer»

hi there to all my friends specially you !
well. i have a reg key (myreg.reg) when i double click it.. it exports some data to registry and it's just fine
now here's the problem= i want to ADD these data through a batch file(not myreg.reg file) so i think i should USE REG ADD right?
here is my reg data

Quote

REGEDIT4

[HKEY_CURRENT_USER\Software\My Own File Sorter]

[HKEY_CURRENT_USER\Software\My Own File Sorter\Regcode]
@="DCFA1E43-4F572A3A-C6EC9F67-8A1C9C41-0607E9D7-BF1FDF3A-AE703C7E-B3666661"

[HKEY_CURRENT_USER\Software\My Own File Sorter\User]
@="new user"

i copid these data into a new batch file and replaced [ ] with " " then i added REG ADD at the beginning of each line so it looks like this

Quote
REG ADD "HKEY_CURRENT....
REG ADD "HKEY_CURRENT....
it adds each line successfully into the registry but it's not working what's wrong? can you fix it for me? Hello, mioo_sara.
You should use 'Reg Add', not 'Add reg'
For additional help go here.sorry i mistyped it !! i changed it to REG ADD and it still is not working !! why?
i believe problem is in lines (3 and 5)
by the way i updated my first post
thanks dear archer
i am wating can someone solve the problem?reg add "HKCU\Software\My Own File Sorter" /v Regcode /d "DCFA1E43-4F572A3A-C6EC9F67-8A1C9C41-0607E9D7-BF1FDF3A-AE703C7E-B3666661"
Code: [Select]REGEDIT4
;@start regedit /s "%~f0"&goto :eof
[HKEY_CURRENT_USER\Software\My Own File Sorter]

[HKEY_CURRENT_USER\Software\My Own File Sorter\Regcode]
@="DCFA1E43-4F572A3A-C6EC9F67-8A1C9C41-0607E9D7-BF1FDF3A-AE703C7E-B3666661"

[HKEY_CURRENT_USER\Software\My Own File Sorter\User]
@="new user"thank you both (Prince_ and Reno)
well Prince_ solved the problem thank you very much
but RENO although my problem is solved but just for learning purpose i ask this question=
in your codes all values are EXPORTED into registry and i don't see any error but it's not working(with your code not Prince_)
i changed "Regcode" line as you posted and "User" line as you see below

Quote
reg add "HKCU\Software\My Own File Sorter"

reg add "HKCU\Software\My Own File Sorter" /v Regcode /d "DCFA1E43-4F572A3A-C6EC9F67-8A1C9C41-0607E9D7-BF1FDF3A-AE703C7E-B3666661"

reg add "HKCU\Software\My Own File Sorter" /v User /d "new user"

but although it hasn't error but it's not working what's the CORRECT algorithm?
well as i mentioned problem is solved with ( Prince_ ) codes and it's just for educational purpose so if you don't have time ignore iti have had trouble with an error that comes up , it says error when write data to registry. how does one correct that ?Quote from: worrywart2009 on AUGUST 31, 2009, 02:45:37 AM
i have had trouble with an error that comes up , it says error when write data to registry. how does one correct that ?

Worrywart2009,

You need to start your own thread.


Discussion

No Comment Found