tutor2000 0 Posted May 31, 2004 Anyone know how to read a file line in vbs? I don't even understand how to open the file yet. I need it for an autoitx project and autoitx cannot read file lines only ini's Rick Only $2.00 with Resale Rights How to Block Better for Martial Artists and NonMartial Artistshttp://kirkhamsebooks.com/MartialArts/Bloc...tterEbook_m.htm Share this post Link to post Share on other sites
condoman 4 Posted May 31, 2004 Here is some sample code:Dim fso, f1, f2, sfile1 = "C:\WSH\testfile.txt"file2 = "C:\WSH\@ph\testfile.txt"file3 = "C:\WSH\testfile2.txt"Set fso = CreateObject("Scripting.FileSystemObject")Set f1 = fso.CreateTextFile(file1, True)WScript.StdOut.Writeline "Writing file"' Write a line.f1.Write ("This is a test.")' Close the file to writing.f1.CloseWScript.StdOut.WriteLine "Moving file to c:\tmp"' Get a handle to the file.Set f2 = fso.GetFile(file1)' Move the file.f2.Move (File2)WScript.StdOut.WriteLine "Copying file to c:\temp"' Copy the file to \temp.f2.Copy (file3)WScript.StdOut.WriteLine "Deleting files"' Get handles to files' current location.Set f2 = fso.GetFile(file2)Set f3 = fso.GetFile(file3)' Delete the files.f2.Deletef3.DeleteWScript.StdOut.WriteLine "All done!" Share this post Link to post Share on other sites
tutor2000 0 Posted May 31, 2004 Thanks bradah After I look it over being a newbie to vbscript I'll probbly have more questions Rick Only $2.00 with Resale Rights How to Block Better for Martial Artists and NonMartial Artistshttp://kirkhamsebooks.com/MartialArts/Bloc...tterEbook_m.htm Share this post Link to post Share on other sites