Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Registry key
#1
Hello

sorry to seem so dumb, but if i can easily retreive a key value in registry, i can't find a way to store all values.

Ex: i have a key like this : HKEY_CURRENT_USER\Software\MySoftware which contains many datas.

I want to get all datas of that key, not a specific one.
str s
rget(s "" "Software\MySoftware" HKEY_CURRENT_USER) does not work.

Any idea?

Thanks
#2
Macro Macro1779
Code:
Copy      Help
ARRAY(str) a
sys.RegGetValues(a "Software\gindi\qm2\settings" 0 1)
int i
for i 0 a.len
,out F"{a[0 i]}={a[1 i]}"
#3
it's a normal windows key, not related to QM
And i don't want an array with key pairs, but a string variable containing all datas, like a .reg file
or exported file.

Sorry for being unclear
#4
Change key in the code.
#5
Quote:And i don't want an array with key pairs, but a string variable containing all datas, like a .reg file
or exported file.

QM does not have such function, but you can use regedit with command line to export a key to .reg. Google for regedit command line.
#6
Also can be used API functions RegSaveKey and RegRestoreKey, but the exported data is binary, and it can be imported to registry only on same Windows OS version.
#7
Ok, was actually looking for a way to avoid using regedit. Maybe in a future QM version wishlist.

Can QM intercept regedit output to put it in a variable instead of writing a file?
#8
No.
Run regedit with run flag 0x400 (wait for exit). Then load the output file into a str variable with getfile.
#9
Actually such QM functions exist, but they export to an XML file, not to a reg file.
You can find them in first topic of QM Extensions subforum. Also attached here.


Attached Files
.qml   Registry export import XML.qml (Size: 3.3 KB / Downloads: 493)
#10
Love the xml stuff, there is a xml to txt function available?
#11
XML is a text format.
If you need to store XML text to a str variable instead of file, you can easily edit the functions.
#12
i was thinking of a function to convert xml file to plain text file to convert it in .reg....

run "C:\Windows\regedit.exe" "/E q:\MyKey.reg ''HKEY_CURRENT_USER\Software\MyKey''" "" "" 0x400

does not work....
#13
Works on my PC. Maybe regedit is disabled on your PC.
#14
Nope, was a runas problem.

adding 16|0x10400 at the end of command line makes it work


Forum Jump:


Users browsing this thread: 9 Guest(s)