Jump to content

multiple key names under same INI section


Recommended Posts

heres what im trying to do...

find all the PCs in a given subnet and enter them into an INI file like so:

[LOCATION1_ASSETS]

JEM=D0056979

OSREC52=D0095304

this becomes a problem when one of the users has two PCs! bc as some of you mentioned, you cant have multiple entries with the same key name.

how can i add a 2 if the entry already exists?

If FileExists ("\\" & $aResult & "\c$") Then

$user=RegRead("\\" & $aResult & "\HKEY_LOCAL_MACHINE\SOFTWARE\Altiris\Altiris Agent\Inventory", "PrimaryUser")

$usr=StringSplit($user,"\")

If @error Then

ContinueLoop

EndIf

IniWrite($ini, "LOCATION1_ASSETS", $usr[2], $aResult)

EndIf

Link to comment
Share on other sites

clever idea.

but i think when the ini is being read.. having the same values will confuse it.

Huh? What do you mean having the same values? If a user has two or more PCs save them as weaponx suggested, i.e.:

[LOCATION1_ASSETS]
JEM=D0056979,D0098923
OSREC52=D0095304
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...