write a vb script to open a text file and write into it

Answers were Sorted based on User's Feedback



write a vb script to open a text file and write into it..

Answer / mudaseer

dim vfso
set vfso=createobject("scripting.filesystemobject")
set vf=vfso.opentextfile("C:\hello.txt",2)
vf.write("howruthere")


'here 2 is for write and 8 is for append

Is This Answer Correct ?    2 Yes 0 No

write a vb script to open a text file and write into it..

Answer / sojan davis- infosys

Const ForWriting = 2,
Dim fso, fileObj
Set fso = CreateObject("Scripting.FileSystemObject")
Set fileObj = fso.OpenTextFile(strConfigFile, ForWriting,
True)
fileObj.WriteLine("Hi")

fileObj.Close
Set fileObj=Nothing
Set fso=Nothing

Is This Answer Correct ?    2 Yes 0 No

Post New Answer

More VB Script Interview Questions

Explain about the functionality of vb script?

0 Answers  


Which event is triggered when mouse focus comes out of an element in the vbscript language?

0 Answers  


How can you destroy an object in vbscript?

0 Answers  


Which date function is used in the vbscript language to find the difference between the 2 dates?

0 Answers  


What are events in the vbscript language?

0 Answers  






what is the code in QTP to take screen shot? Please send me any one to my mail id. my mailid is manu.sanepalli@gmail.com

4 Answers   TCS,


write any ttest cases using check points and parameterization

0 Answers  


What is the event handling in vbscript?

0 Answers  


I need to get some data from data base and store this (retrieved) data in a excel sheet using VB script in QTP9.0 I have created connection for data base I have created as excels sheet by using Set XL=CreateObject("Excel.Application") XLworksheet.cells(1,1).value= rs.fields.item("<<The data retrieved from data base >>") I have taken a for loop and changed the cells values (1 as i and another 1 as j) But still I am not able to get Plz kindly tell me know this . It is very urgent

0 Answers  


which is the bset training centre to learn automation tools?

2 Answers  


how to acces the remote mechine using vb cript(QTP)

0 Answers   TCS,


Can someone please tell me what poor design in a relational database (not the layout or style) is and how it can be avoided? PLEASE...im desperate.

0 Answers  


Categories