Jump to content

How To Search An Ini For Name


Recommended Posts

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.

Link to comment
Share on other sites

  • Developers

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

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...