GregP 0 Posted August 25, 2005 I'm trying to determine if an application is installed by using RegRead. Based on the Autoit Help - I believe my syntax is correct. I'm testing on a W2K pc that has the registry key. I created a msgbox - to see the what is in the variable - but it returns nothing. The registry key type is "REG_SZ" and the value is "3.5.0.0.384". Any help would be greatly appreciated. ------------------------------------------------------------------------------------------- $HFM = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Hyperion Solutions\Hyperion Financial Management\Install","VERSION") MsgBox(32,"DEBUG","The value of $HFM is", $HFM) ------------------------------------------------------------------------------------------- Greg Share this post Link to post Share on other sites
SupraNatural 0 Posted August 25, 2005 (edited) uhm is that msgbox correct? Shouldn't it be MsgBox(32,"DEBUG","The value of $HFM is" & $HFM) Edited August 25, 2005 by SupraNatural Visit http://www.blizzedout.com/forums/register....referrerid=8306 for the top blizzard hacks. WoW, TfT, D2/LOD, CS. You name it we got it! Share this post Link to post Share on other sites
GregP 0 Posted August 25, 2005 uhm is that msgbox correct? Shouldn't it be MsgBox(32,"DEBUG","The value of $HFM is" & $HFM)<{POST_SNAPBACK}>Thanks for the feedback ...... per the Autoit Help on RegRead gives the following example==========================================$var = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft Windows\CurrentVersion", "ProgramFilesDir")MsbBox(4096, "Program files ar in:", $var)=========================================I tried adding the & in my script and got a "Error in Expression" message.Greg Share this post Link to post Share on other sites
SupraNatural 0 Posted August 25, 2005 (edited) Nooo you did MsgBox(32,"DEBUG","The value of $HFM is", $HFM)Notice there are 4 ,'s when there should be 3. (flag,title,message,[timeout])so you are telling it:Flag = 32Title = DebugMsg = The value of $HFM isTimeout = $HFMWhen it should be:MsgBox(32,"DEBUG","The value of $HFM is" & $HFM) Flag, Title,"msgFlag = 32Title = DebugMsg =The value of $HFM is & $HFM Edited August 25, 2005 by SupraNatural Visit http://www.blizzedout.com/forums/register....referrerid=8306 for the top blizzard hacks. WoW, TfT, D2/LOD, CS. You name it we got it! Share this post Link to post Share on other sites
seandisanti 3 Posted August 25, 2005 (edited) uhm is that msgbox correct? Shouldn't it be MsgBox(32,"DEBUG","The value of $HFM is" & $HFM)<{POST_SNAPBACK}>yep***edit***just to elaborate - the comma between the values tells the message box that the last value is a seperate argument, which obviously you're not tyring to do. you're trying to concatenate the strings, which is done with the '&' not the ",". lose the comma, add an '&' and you're all set. Edited August 25, 2005 by cameronsdad Share this post Link to post Share on other sites
SupraNatural 0 Posted August 25, 2005 yep***edit***just to elaborate - the comma between the values tells the message box that the last value is a seperate argument, which obviously you're not tyring to do. you're trying to concatenate the strings, which is done with the '&' not the ",". lose the comma, add an '&' and you're all set.<{POST_SNAPBACK}>exactlyp.s. has the autoit site been going down for anyone else? Visit http://www.blizzedout.com/forums/register....referrerid=8306 for the top blizzard hacks. WoW, TfT, D2/LOD, CS. You name it we got it! Share this post Link to post Share on other sites
BigDod 518 Posted August 25, 2005 Thanks for the feedback ...... per the Autoit Help on RegRead gives the following example==========================================$var = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft Windows\CurrentVersion", "ProgramFilesDir")MsbBox(4096, "Program files ar in:", $var)=========================================I tried adding the & in my script and got a "Error in Expression" message.Greg<{POST_SNAPBACK}>The help file is correct and if you follow the example you should have usedMsgBox(4096, "The value of $HFM is", $HFM) And that would have given you your answer. Time you enjoyed wasting is not wasted time ......T.S. Elliot Suspense is worse than disappointment................Robert Burns God help the man who won't help himself, because no-one else will...........My Grandmother Share this post Link to post Share on other sites
SupraNatural 0 Posted August 25, 2005 Im pretty sure we've all told him the same thing... Visit http://www.blizzedout.com/forums/register....referrerid=8306 for the top blizzard hacks. WoW, TfT, D2/LOD, CS. You name it we got it! Share this post Link to post Share on other sites
Danny35d 9 Posted August 25, 2005 Thanks for the feedback ...... per the Autoit Help on RegRead gives the following example==========================================$var = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft Windows\CurrentVersion", "ProgramFilesDir")MsbBox(4096, "Program files ar in:", $var)=========================================I tried adding the & in my script and got a "Error in Expression" message.Greg<{POST_SNAPBACK}>If you look at the help example between the parenthesis there are only two commas; meaning MSGBOX(flag, title, text) in your syntax you have between the parenthesis tree commas:MsgBox(32,"DEBUG","The value of $HFM is", $HFM)and like SupraNatural said:MsgBox(32,"DEBUG","The value of $HFM is" & $HFM)change the last , to & and the script will work.... AutoIt Scripts:NetPrinter - Network Printer UtilityRobocopyGUI - GUI interface for M$ robocopy command line Share this post Link to post Share on other sites
GregP 0 Posted August 25, 2005 Nooo you did Notice there are 4 ,'s when there should be 3. (flag,title,message,[timeout])so you are telling it:Flag = 32Title = DebugMsg = The value of $HFM isTimeout = $HFMWhen it should be:Flag = 32Title = DebugMsg =The value of $HFM is" & $HFM<{POST_SNAPBACK}>Ok - I think were a little off-track here - my original code was: ===========================================$HFM = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Hyperion Solutions\Hyperion Financial Management\Install","VERSION")IF $HFM = "3.5.0.0.384" Then====================================================The IF statement was continually failing - so I added the following to determine if the RegRead command was working correctly================================================MsgBox(32,"DEBUG","The value of $HFM is", $HFM)================================================The MsgBox was returning "The value of $HFM is "====================================================Per your reply I changed the msgbox to this=====================================================MsgBox(32,"DEBUG","The value of $HFM is", & $HFM)==================================================I got an Autoit Error - pointing to the &. Either way - just by the fact that the IF statement is failing - tells me that $HFM doesn't have any value. Is there anything I'm doing wrong or should know about with the RegRead command?? Share this post Link to post Share on other sites
GregP 0 Posted August 25, 2005 If you look at the help example between the parenthesis there are only two commas; meaning MSGBOX(flag, title, text) in your syntax you have between the parenthesis tree commas:MsgBox(32,"DEBUG","The value of $HFM is", $HFM)and like SupraNatural said:MsgBox(32,"DEBUG","The value of $HFM is" & $HFM)change the last , to & and the script will work....<{POST_SNAPBACK}>Sorry - I wasn't able to see all of the replies - either my browser or the Autoit website having a problem?Ok - I change the syntax to===============================================$HFM = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Hyperion Solutions\Hyperion Financial Management\Install","VERSION")MsgBox(32,"DEBUG","The value of $HFM is" & $HFM)================================================It returns the correct value! So there must be something going on with my IF statement code following the RegRead command.Thanks for all your help!!!=============================================== Share this post Link to post Share on other sites
SupraNatural 0 Posted August 25, 2005 LoL yea its frustrating trying to explain something little like that. Visit http://www.blizzedout.com/forums/register....referrerid=8306 for the top blizzard hacks. WoW, TfT, D2/LOD, CS. You name it we got it! Share this post Link to post Share on other sites