Sign in to follow this  
Followers 0
BigDaddyO

How To Search An Ini For Name

3 posts in this topic

I am trying to search a listing in an INI file to see if it matches what is being pulled from a comptuer.

I have a pretty long list of hard drive volume labels and what I want to do is the DriveGetLabel and then check the return to see if it matches what is in the list in the INI.

I currently have $Volume = DriveGetLabel("C:\")

I figure I have do do a While statement or something like that if $Volume = INIREAD info. but I just can't seem to figure it out.


Share this post


Link to post
Share on other sites



In this example if the volume name is Data or program it will return FOUND:

$Volume = DriveGetLabel("C:\") 
If IniRead('label.ini','drivelabels',$Volume,'???') = '???' Then
   msgbox(0,'drivelabel', 'label:'& $Volume & ' not found') 
Else
   msgbox(0,'drivelabel', 'label:'& $Volume & ' found') 
EndIf

File label.ini

[drivelabels]data=y

program=y


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

That worked great. I never really looked that closely at the default section of the iniRead.

Thanks


Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0