The reason I am doing this is because I have scripts that install
an MSI file on each machine and this program/msi uses a ini file called
fsp.ini. If I need to for any reason uninstall the msi file with a switch /u, it destroys the fsp.ini file. which means that I have to remote into 150 PCs and change one line entry "pcAlias=(blank)" to "pcAlias=(pcname)".(each pass of the fsp.ini mod will have the previous pcname
to the right of the "=" sign). There is only one entry that is exclusive and that is the pcname on the right side of "pcAlias=" and the rest of the "ini" file
is the same canned soup for each pc. The only thing that changes is the pcname so I want to auto generate it. I already use the LDAP program yo guys helped me build to fill my arrays of $Elements up so I just need to
do the simple algorithm I have outline below.

and sorry sow late getting back to you all. I have been sick as a dog.
when i get sick PC time is at a hault. but I am better now.

thank you Glenn and Apronk for your help! you dudes rock!

so what do you think after all this info????



 Code:
/* my algorithm ; trying to kee it simple */
for each $Element in $Branch

	file open
        read in line that matches "pcAlias="
        swap string "pcAlias=" with "pcAlias=$Element"
        writeline that is "pcAlias=$Element"
        file close
        copy fsp.ini to that $Element
        
Next $Element






 Code:
/* this is top of the ini file called fsp.ini */
[Ubs]
LastUser=rvand
pcAlias=pcname
PortNumber=9600
HostName=192.168.1.94
SessionName=Original Session

/* there is more but the top is all I need */


Edited by itdaddy (2009-12-02 05:10 PM)
_________________________
Robert
A+, CCNA, MCP
Network Admin
Credit Union Wisconsin