Page 1 of 1

Update current .reg file

Posted: 12 Jan 2015 16:46
by binocular222
You backed-up settings by exporting to a .reg file, then after a while, you need to update that file by going to regedit > export > overwrite old .reg file.
XY can automate that process by adding this line to PFA:

Code: Select all

"Update|%windir%\regedit.exe" reg>::$Path = trim(trim(gettoken(readfile("<curitem>"),3,"<crlf>"),'[',"L"),']',"R"); Run "reg export ""$Path"" ""<curitem>"" /y"
It simply read the 3rd line from current .reg file to get the registry path > export everything there (include subkeys).

Of course this is crude and rudiment. A more sophisticated way would be reading all the keys but that would involve a bit more lengthy script.