|
-
May 13th, 2002, 05:10 PM
#1
Thread Starter
Hyperactive Member
I need a VBS script for reading a text file
I need a VBS script (a *.vbs file)
That can read a TXT file in the same folder as the VBSscript is..
But I could not make it work by using things like:
Code:
Open "Test.txt" For Input As #1
Do While Not EOF(1)
Line Input #1, s
strFromFile = strFromFile & s & vbCrLf
Loop
Close #1
msgbox strFromFile
So then, What must i use inorder to get a VBS to read a txt file
and read it into a variable, then MSGBOX the variable to the screen.. But its important for it to be put in a variable...
Cause I will use the variable further on, after reading the file into it...
and NO, i dont want to make a EXE file, just a VBS script
***************
Please use [highlight=vb] ..your code.. [/highlight] when posting code!
When you have received the working answer to your question,
please mark it as *SOLVED* + Your Questions Title ...using your Thread's Tool menu.
Also try to point out what answer made it work for you, or edit your first post to contain a quote of the correct answer...
Please Answer All Questions With Working Code Examples...
My Unfinished Projects and My working Programs
***************
-
May 14th, 2002, 10:41 AM
#2
Black Cat
VBScript needs to use an external object, ie, FileSystemObject, to read files (or to do almost anything useful, for that matter).
Josh
Get these: Mozilla Opera OpenBSD
I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|