I see something I neglected to put in the code. This may be better:

 Code:
for each $Element in $PClist
    $array = ReadFile(@LDRIVE&"\fsp.ini")     ;read "master" ini file into array
    $array[2] = "pcAlias="+$Element ;set value array(2) to string value
    $ = WriteFile("\\"+$Element+"\C$\fsp.ini",$array) ;write array back to file on the target machine.
next

From what you've said, I assume that the INI file is static, aside from the one line. That being the case, there's no need to look for the line, or to verify what the line says.

A "master" INI file (which can be located on, say, @LDRIVE or some other network location) gets read into an array (since the INI file can get deleted from the remote systems, this make for a safety net). The value you want to change will always be the third line in the file, so I'm simply changing the value of $array[2] to reflect the correct target. Then, the array gets written to a file on the target machine with the appropriate value in there.


Edited by eriqjaffe (2009-12-02 06:24 PM)