supraspecies Posted June 27, 2012 Share Posted June 27, 2012 Good day. I've searched the forum thoroughly, and haven't found the answer to my problem. Straight to business, not to waste more of your time:I need to read program path from the registry. Point is - there isn't a direct path. There is a reference to EXE. For example:RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\program.exe", "Path")would read the value:C:\Program Files\Program\Program.exe.while I need only the path, like this:C:\Program Files\Program\Is there any way I can subtract the \program.exe from the value and have just the path? Relatively simple way, if there is any, would be very much appreciated, since I'm a newbie. Thank you in advance. Link to comment Share on other sites More sharing options...
JohnOne Posted June 27, 2012 Share Posted June 27, 2012 $s = 'C:\Program Files\Program\Program.exe.' $pos = StringInStr($s,'\',0,-1) $stripped = StringTrimRight($s,StringLen($s) - $pos) ConsoleWrite($stripped & @LF) AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
supraspecies Posted June 27, 2012 Author Share Posted June 27, 2012 (edited) @ JohnOne Works perfectly! Thank you very much for your help! Edited June 27, 2012 by supraspecies 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