eJan 0 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 Share this post Link to post Share on other sites
therks 33 Posted March 25, 2005 Uhm.. RegDelete? My AutoIt Stuff | My Github Share this post Link to post Share on other sites
eJan 0 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 Share this post Link to post Share on other sites
therks 33 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 Share this post Link to post Share on other sites
eJan 0 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! Share this post Link to post Share on other sites