Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Vbscript to read .txt file for input

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,31649
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Vbscript to read .txt file for input
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Vbscript to read .txt file for input - 2/28/2006 12:04:07 PM   
  ps0303

 

Posts: 13
Score: 0
Joined: 2/28/2006
Status: offline
I'm having a bit of an issue, I have a text file with computer names in it and I am trying to read in each line and then perform a ping, then move to the next line, repeat. Of course logging in there as well.

file is like this:
test1
test2
test3

I have found many examples of reading in a single name which has been declared in the script or entered in a text box but none that read in a text file.  Any ideas or samples that show how this is done?

Thx.
 
 
Post #: 1
 
 RE: Vbscript to read .txt file for input - 2/28/2006 12:12:28 PM   
  Cybex


Posts: 412
Score: 0
Joined: 9/14/2005
From: Florida
Status: offline
Search the boards I think I have seen this covered.
Set and open the file and then read in the content.

.Readline()


Cybex

_____________________________

Common sense is not so common.

(in reply to ps0303)
 
 
Post #: 2
 
 RE: Vbscript to read .txt file for input - 2/28/2006 1:01:12 PM   
  binHEX


Posts: 9
Score: 1
Joined: 9/2/2005
Status: offline
I would ordinarily say that you should go do a search of the forum before asking for people to write a script for you.
But, since this was one of the very first questions I had on vbscripting (how to read a file, line by line), I'll give you a real simple script that you can start with.
If you are interested in learning, and not just having someone else write all of your scripts for you, I would suggest that you read the sticky posts at the beginning of this forum for a start.


      

< Message edited by binHEX -- 2/28/2006 1:02:32 PM >

(in reply to Cybex)
 
 
Post #: 3
 
 RE: Vbscript to read .txt file for input - 2/28/2006 1:48:54 PM   
  ps0303

 

Posts: 13
Score: 0
Joined: 2/28/2006
Status: offline
Thanks for the input.  I have been searching for many days off and on to find the help I needed. I have read this forum and several others but never really found exactly what I needed.  Many people ask how to get input into a text file, that part I have created.

I'm a little taken back by the way that it was percieved that I wanted someone to write my script.  For the hour or so searching this forum for answers, I have seen many people ask a question in the same manner as I yet never really been told to what I was told to do.  The internet and forums are not new to me but vbscripting is.

Next time before I post will add a preface something like " I don't want you to write my script and I have been searching for hours for some answers yet I haven't found anything that I feel works or works like I need it as I am new to vbscripting."

Thanks for the info and yet somewhat cold shoulder.

(in reply to ps0303)
 
 
Post #: 4
 
 RE: Vbscript to read .txt file for input - 2/28/2006 3:10:23 PM   
  Cybex


Posts: 412
Score: 0
Joined: 9/14/2005
From: Florida
Status: offline
I am sorry you feel that we gave you a cold shoulder.  I can only guess that since you are new to VBScripting that you must not have noticed the other posts that contain code examples of almost the exact information you were asking about.  We do everything we can to help anyone here, we only request that you search the forum first.  We get mutiple questions on topics we have answered many times in the past.


Cybex

_____________________________

Common sense is not so common.

(in reply to ps0303)
 
 
Post #: 5
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Vbscript to read .txt file for input Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts