No need to shell out, you could just have WriteFile() directly write the file. Now that I see a bit more what you're going for, there really isn't any need to look for that string every time, either:

 Code:
$array = ReadFile(@SCRIPTDIR+"\fsp.ini")
$loc = AScan($array, "pcAlias=",,,1)

if $loc <> =1
  for each $Element in $PCList
     $array[$loc] = "pcAlias="+$Element
     $ = WriteFile("\\"+$Element+"\c$\windows\fsp.ini")
  next
endif



Edited by eriqjaffe (2009-11-25 10:14 PM)