looking in a text file

Anything VBScript-related, including Windows Script Host, WMI, ADSI, and more.
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Locked
User avatar
jimbo101974
Posts: 40
Joined: Wed Oct 31, 2007 11:01 pm

looking in a text file

Post by jimbo101974 » Thu Jul 31, 2008 4:10 am

I was wondering if someone could offer me some guidance. I am in the process of trying to write a script to update an element in an XML file. I want to put a list of computers I need this file run on and have the script execute for each computer. what would the syntax be in the script that would tell it for each computer in pc.txt do this? Thanks.

jvierra
Posts: 14132
Joined: Tue May 22, 2007 9:57 am
Contact:

looking in a text file

Post by jvierra » Thu Jul 31, 2008 5:06 am

Sorry - it was just a simple example to point you in the right direction. There were two typos (my fault) but here is teh good code.


Set fso = CreateObject("Scripting.FileSystemObject")Set file = fso.OpenTextFile("pc.txt")while Not file.AtEndOfStream WScript.Echo file.ReadLine()Wend

User avatar
jimbo101974
Posts: 40
Joined: Wed Oct 31, 2007 11:01 pm

looking in a text file

Post by jimbo101974 » Thu Jul 31, 2008 5:22 am

That's better. Thanks. I'm still a bit of a greenhorn.

Locked