Link to home
Start Free TrialLog in
Avatar of z27
z27

asked on

Get Path of application from Reg (Run) (win2000)

Hello Experts!

 PLease help me, i want to get path of apps in  key Run of
registry and result are, for example:

 "C:\Program Files\Zone Labs\ZoneAlarm\zlclient.exe"
or
 "C:\Program Files\McAfee\QuickClean\Plguni.exe" /START
or
 mobsync.exe /logon

 i want get full path (eg: Remove "", parameter/,...)

ex:  
 C:\Program Files\Zone Labs\ZoneAlarm\zlclient.exe
 C:\Program Files\McAfee\QuickClean\Plguni.exe

 Thank you.
 
ASKER CERTIFIED SOLUTION
Avatar of Ivanov_G
Ivanov_G
Flag of Bulgaria image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of z27
z27

ASKER

Yes, but i want to parse string:
  "C:\Program Files\Zone Labs\ZoneAlarm\zlclient.exe"
to: C:\Program Files\Zone Labs\ZoneAlarm\zlclient.exe
  (remove " ")

mobsync.exe /logon
to: mobsync.exe ( remove  /logon)

 
 
StringReplace(yourstring, '"', '', [rfReplaceAll])
will remove those " from the string
first as mikelittlewood suggested
 StringReplace(yourstring, '"', '', [rfReplaceAll])

and them
  ExtractFileName(....) to get the filename without directory and parameters
Avatar of z27

ASKER

i want to get full path og app, my app need to read registry (autorun) to finding apps register autorun and locating them on harddisk. But 0n win2000  get some string as asked on topic, i donnot know how parse these strings to get exactly their path.
check the following functions in Delphi help.

ExtractFileDir
ExtractFileDrive
ExtractFileExt
ExtractFileName
ExtractFilePath
Avatar of z27

ASKER

hello Ivanov_G, please read my question again!

 You cannot Extract...('"C:\Program Files\Zone Labs\ZoneAlarm\zlclient.exe"');

or

Extract...('mobsync.exe /logon');
You can not get the full path for mobsync.exe, because it is somewhere in %SYSTEM% folder. For other files you can freely use the function I showed above + StringReplace to create some logic to extract the file paths. You can also use FileExists function to check if the specified file exists on the local machine.
No comment has been added to this question in more than 21 days, so it is now classified as abandoned.

I will leave the following recommendation for this question in the Cleanup topic area:
   Accept: Ivanov_G {http:#13733627}

Any objections should be posted here in the next 4 days. After that time, the question will be closed.

cwwkie
EE Cleanup Volunteer