Sign in to follow this  
Followers 0
rgj_time

Registry Manipulation

10 posts in this topic

I need to know how to export a reg value in v3. I have the syntax for v2, but I havn't been able to translate. Any clues??

Share this post


Link to post
Share on other sites



I need to know how to export a reg value in v3.  I have the syntax for v2, but I havn't been able to translate.  Any clues??

If export means the use of regedit /s to save in a file that's no change.

But If you were using

RegRead, Variable, ValueType, RegKey, RegSubkey, ValueName

now you get

RegRead ( "keyname", "valuename" )

I hope that help. Have the look at the help sometimes :whistle: it does

Share this post


Link to post
Share on other sites

RunWait (@ComSpec & "Regedit /s" & "HKEY_LOCAL_MACHINE\SOFTWARE\Atria\ClearCase

\CurrentVersion")

The above is one of the lines I have tried. I'm I close??

Share this post


Link to post
Share on other sites

RunWait (@ComSpec & "Regedit /s" & "HKEY_LOCAL_MACHINE\SOFTWARE\Atria\ClearCase

\CurrentVersion")

The above is one of the lines I have tried.  I'm I close??

Yes your are close just you miss a

RunWait (@ComSpec & " /c Regedit /s" & "HKEY_LOCAL_MACHINE\SOFTWARE\Atria\ClearCase

\CurrentVersion")

Share this post


Link to post
Share on other sites

"regedit /s" IMPORTS registry settings, I don't believe there's a way using regedit.exe to export a key.

You can use reg.exe built into WinXP. It's not included in Win2K, but I think it's in either the Win2K Support Tools or Resource Kit.

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

If it is a WinXP box you can use the reg.exe command line as follows.

REG.exe export HKLM\Software\Microsoft\Updates Updates.reg

This will give you a return code of 0 for success or 1 for failure.

Edited by bcording

Share this post


Link to post
Share on other sites

"regedit /s" IMPORTS registry settings, I don't believe there's a way using regedit.exe to export a key.

Close, but all the /S switch means is "Silent". Here are the Regedit switches.

/L:system Specifies the location of the SYSTEM.DAT file.

/R:user Specifies the location of the USER.DAT file.

filename1 Specifies the file(s) to import into the registry.

/C filename2 Specifies the file to create the registry from.

/E filename3 Specifies the file to export the registry to.

Regpath1 Specifies the starting registry key to export from. (Defaults to exporting the entire registry).

/D regpath2 Deletes the specified registry key.

/S Silent merge (no confirmation dialogs)


George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites

FYI--

RunWait (@ComSpec & " /c" & " regedit /e" & " " & $outlook & " " & $reg_key)

1. where $outlook is c:\temp\outlook.reg and

2. $reg_key will end with the registry key you want exported to the above file location.

3. The " " forces a space between the arguments.

Share this post


Link to post
Share on other sites

You could also

RunWait (@ComSpec & " /c regedit /e " & $outlook & " " & $reg_key)

red

Share this post


Link to post
Share on other sites

FYI, it appears that the text file produced by "regedit /e" is badly formatted (contains lots of null characters).

This is issue only if you plan the read the reg file using AutoIt's FileReadLine.

One way to fix the file formatting is to do somthing like this:

RunWait (@ComSpec & " /c type " & $orgFile " > " & $newFile)


Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0