Sign in to follow this  
Followers 0
sleepydvdr

Registry entry not working well with AutoIt

3 posts in this topic

This is the first time AutoIt has not applied registry entries correctly for me. Here's my original code:

REGEDIT4

[HKEY_CURRENT_USER\Software\DVD Shrink\DVD Shrink 3.2\Preferences]
"BrowserViewMode"=dword:00000001
"frame_x"=dword:00000025
"frame_y"=dword:00000032
"frame_wide"=dword:00000259
"frame_high"=dword:0000028a
"ProfileAudio"=dword:00000000
"ProfileAudioType"=dword:00000002
"ProfileSubpicture"=dword:00000000
"ProfileDisableSubpicture"=dword:00000000
"ToolBar"=dword:00000404
"frame_xbar"=dword:00000122
"frame_ybar"=dword:000000dd

Here's my AutoIt conversion:

RegWrite("HKEY_CURRENT_USER\Software\DVD Shrink\DVD Shrink 3.2\Preferences","BrowserViewMode","REG_DWORD",'00000001')
RegWrite("HKEY_CURRENT_USER\Software\DVD Shrink\DVD Shrink 3.2\Preferences","frame_x","REG_DWORD",'00000025')
RegWrite("HKEY_CURRENT_USER\Software\DVD Shrink\DVD Shrink 3.2\Preferences","frame_y","REG_DWORD",'00000032')
RegWrite("HKEY_CURRENT_USER\Software\DVD Shrink\DVD Shrink 3.2\Preferences","frame_wide","REG_DWORD",'00000259')
RegWrite("HKEY_CURRENT_USER\Software\DVD Shrink\DVD Shrink 3.2\Preferences","frame_high","REG_DWORD",'0000028a')
RegWrite("HKEY_CURRENT_USER\Software\DVD Shrink\DVD Shrink 3.2\Preferences","ProfileAudio","REG_DWORD",'00000000')
RegWrite("HKEY_CURRENT_USER\Software\DVD Shrink\DVD Shrink 3.2\Preferences","ProfileAudioType","REG_DWORD",'00000002')
RegWrite("HKEY_CURRENT_USER\Software\DVD Shrink\DVD Shrink 3.2\Preferences","ProfileSubpicture","REG_DWORD",'00000000')
RegWrite("HKEY_CURRENT_USER\Software\DVD Shrink\DVD Shrink 3.2\Preferences","ProfileDisableSubpicture","REG_DWORD",'00000000')
RegWrite("HKEY_CURRENT_USER\Software\DVD Shrink\DVD Shrink 3.2\Preferences","ToolBar","REG_DWORD",'00000404')
RegWrite("HKEY_CURRENT_USER\Software\DVD Shrink\DVD Shrink 3.2\Preferences","CustomToolBar","REG_SZ",'')
RegWrite("HKEY_CURRENT_USER\Software\DVD Shrink\DVD Shrink 3.2\Preferences","frame_xbar","REG_DWORD",'00000122')
RegWrite("HKEY_CURRENT_USER\Software\DVD Shrink\DVD Shrink 3.2\Preferences","frame_ybar","REG_DWORD",'000000dd')

Well, I have attached a shot of a ExamDiff (a little app that displays the differences between two files. The first file (left side) is the AutoIt version. The right hand side is applying the registry entry manually.

Posted Image

Here's how DVD Shrink looks with the regular registry entry:

Posted Image

Here's how it looks with the AutoIt version:

Posted Image

I've checked the code out so many times it's ridiculous. It does seem to be correct (although I'm no expert).

I usually compile everything with older versions of AutoIt (for smaller file sizes), but even the latest version of AutoIt did the same thing. Does anyone know what's going on with this? Is this possibly a known bug or something? Like I said, I have used AutoIt quite a bit and this is the first time I've seen it. Been scratching my head on this all day long...

post-37989-1216328430_thumb.jpg


#include <ByteMe.au3>

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Your problem is they are being written as string as opposed to the numerical values they are.

Try this (made the key a variable to save space.)

$Key = "HKEY_CURRENT_USER\Software\DVD Shrink\DVD Shrink 3.2\Preferences"
RegWrite($key,"BrowserViewMode","REG_DWORD",0x00000001)
RegWrite($key,"frame_x","REG_DWORD",0x00000025)
RegWrite($key,"frame_y","REG_DWORD",0x00000032)
RegWrite($key,"frame_wide","REG_DWORD",0x00000259)
RegWrite($key,"frame_high","REG_DWORD",0x0000028a)
RegWrite($key,"ProfileAudio","REG_DWORD",0x00000000)
RegWrite($key,"ProfileAudioType","REG_DWORD",0x00000002)
RegWrite($key,"ProfileSubpicture","REG_DWORD",0x00000000)
RegWrite($key,"ProfileDisableSubpicture","REG_DWORD",0x00000000)
RegWrite($key,"ToolBar","REG_DWORD",0x00000404)
RegWrite($key,"CustomToolBar","REG_SZ",'')
RegWrite($key,"frame_xbar","REG_DWORD",0x00000122)
RegWrite($key,"frame_ybar","REG_DWORD",0x000000dd)
Edited by Paulie

Share this post


Link to post
Share on other sites

Your problem is they are being written as string as opposed to the numerical values they are.

Try this (made the key a variable to save space.)

$Key = "HKEY_CURRENT_USER\Software\DVD Shrink\DVD Shrink 3.2\Preferences"
RegWrite($key,"BrowserViewMode","REG_DWORD",0x00000001)
RegWrite($key,"frame_x","REG_DWORD",0x00000025)
RegWrite($key,"frame_y","REG_DWORD",0x00000032)
RegWrite($key,"frame_wide","REG_DWORD",0x00000259)
RegWrite($key,"frame_high","REG_DWORD",0x0000028a)
RegWrite($key,"ProfileAudio","REG_DWORD",0x00000000)
RegWrite($key,"ProfileAudioType","REG_DWORD",0x00000002)
RegWrite($key,"ProfileSubpicture","REG_DWORD",0x00000000)
RegWrite($key,"ProfileDisableSubpicture","REG_DWORD",0x00000000)
RegWrite($key,"ToolBar","REG_DWORD",0x00000404)
RegWrite($key,"CustomToolBar","REG_SZ",'')
RegWrite($key,"frame_xbar","REG_DWORD",0x00000122)
RegWrite($key,"frame_ybar","REG_DWORD",0x000000dd)
Your solution worked perfectly! Thank you very much! I just did a quick read on the '0x' prefix and it confirmed one of my suspicions. I had noticed that the values were hexadecimal and thought that might have something to do with the problem. Now I need to do more reading to fully understand it all.

Thanks for your reply. You kept me from going insane (well, for today at least).


#include <ByteMe.au3>

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