eJan Posted March 25, 2005 Share Posted March 25, 2005 I need help to use clean path or to remove filename from Registry value.RegRead("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\BWMeter", "UninstallString")In my case "UninstallString" is: C:\Program Files\BWMeter\Uninstall.exe Link to comment Share on other sites More sharing options...
therks Posted March 25, 2005 Share Posted March 25, 2005 Uhm.. RegDelete? My AutoIt Stuff | My Github Link to comment Share on other sites More sharing options...
eJan Posted March 25, 2005 Author Share Posted March 25, 2005 (edited) Uhm.. RegDelete?No, because I'd like to use for other scripts, I need string to count chars until "\" or "\*2", and use converted string without filename for updates.*EditNot to modify the Registry. Edited March 25, 2005 by eJan Link to comment Share on other sites More sharing options...
therks Posted March 25, 2005 Share Posted March 25, 2005 Wait... so you want to just pull the bolded part of the text from the RegRead? Use StringInStr. Offhand (not looking at the manual), I think it goes something like this: $string = RegRead("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\BWMeter", "UninstallString") $pos = StringInStr($string, '\', 0, -1) $newstring = StringLeft($string, $pos) msgbox(0, 'get path', $string & '=>' & $newstring) My memory for syntax isn't perfect though. My AutoIt Stuff | My Github Link to comment Share on other sites More sharing options...
eJan Posted March 25, 2005 Author Share Posted March 25, 2005 Wait... so you want to just pull the bolded part of the text from the RegRead?Use StringInStr.Offhand (not looking at the manual), I think it goes something like this:CODE$string = RegRead("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\BWMeter", "UninstallString")$pos = StringInStr($string, '\', 0, -1)$newstring = StringLeft($string, $pos)msgbox(0, 'get path', $string & '=>' & $newstring)My memory for syntax isn't perfect though.Works great, thanks Saunders! Link to comment Share on other sites More sharing options...
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