gcue Posted June 2, 2008 Share Posted June 2, 2008 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 More sharing options...
weaponx Posted June 2, 2008 Share Posted June 2, 2008 Seperate the values with commas when you save them and then use stringsplit to get them back out. Link to comment Share on other sites More sharing options...
gcue Posted June 2, 2008 Author Share Posted June 2, 2008 clever idea. but i think when the ini is being read.. having the same values will confuse it. Link to comment Share on other sites More sharing options...
zorphnog Posted June 2, 2008 Share Posted June 2, 2008 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 More sharing options...
gcue Posted June 2, 2008 Author Share Posted June 2, 2008 the script doesnt know how to handle multiple PCs per user 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