Jump to content

export registry value (not complete key)


svatvn
 Share

Recommended Posts

Hi,

I want to export a single registry value.

i.e. its the reg_sz value "wallpaper" in HKEY_CURRENT_USER\Control Panel\Desktop

if I call regedit /e C:\wallpaper.reg HKEY_CLASSES_ROOTHKEY_CURRENT_USER\Control Panel\Desktop, it exports ALL existing values in the desktop-key.

But I only want to export the single wallpaper value. How can I do that with AutoIT?

Link to comment
Share on other sites

Hello svatvn,

Have you tried RegRead()?

$wallpaper = RegRead('HKEY_CURRENT_USER\Control Panel\Desktop','Wallpaper')
MsgBox(0,'Wallpaper path',$wallpaper)

Realm

My Contributions: Unix Timestamp: Calculate Unix time, or seconds since Epoch, accounting for your local timezone and daylight savings time. RegEdit Jumper: A Small & Simple interface based on Yashied's Reg Jumper Function, for searching Hives in your registry. 

Link to comment
Share on other sites

hi realm,

yes I tried, but how can I tell AutoIt to export the value?

for example I want to have a wallpaper.reg file with the content like:

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Control Panel\Desktop]
"Wallpaper"="D:\\wallpaper.jpg"
Link to comment
Share on other sites

Svatvn,

I am not sure I understand what your attempting to do. Assuming I have read your last post correctly, it appears you want to find the registry value, then write out to a file and have it appear as you have written it in the code box. If this is correct this might point you into a better direction:

$regAddress = 'HKEY_CURRENT_USER\Control Panel\Desktop'
$regKey = 'Wallpaper'

$regPath = RegRead($regAddress,$regKey)

$file = FileOpen(@DesktopDir & '\wallpaper.reg',1) ;1 will append end of file. Change to 2 if you want file overwritten.
FileWrite($file,'Windows Registry Editor Version 5.00' & @CRLF & @CRLF _
              & '[' & $regAddress & ']' & @CRLF _
              & '"' & $regKey & '"="' & $regPath & '"')
FileClose($file)

Realm

My Contributions: Unix Timestamp: Calculate Unix time, or seconds since Epoch, accounting for your local timezone and daylight savings time. RegEdit Jumper: A Small & Simple interface based on Yashied's Reg Jumper Function, for searching Hives in your registry. 

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...