svatvn Posted December 17, 2010 Posted December 17, 2010 Hi,I want to export a single registry value.i.e. its the reg_sz value "wallpaper" in HKEY_CURRENT_USER\Control Panel\Desktopif 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?
Realm Posted December 17, 2010 Posted December 17, 2010 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.
svatvn Posted December 17, 2010 Author Posted December 17, 2010 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"
Realm Posted December 17, 2010 Posted December 17, 2010 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.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now