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

VBscript for QTP,best tutorial?

2 Answers   Wipro,


Explain the arrays in vb script?

0 Answers  


Does VB/Win make standalone .EXE files?

0 Answers  


What is the difference between vbscript and vba?

0 Answers  


i created script for login in QTP,i parametirized that using global sheet,problem i am facing is first i want to login with first values provided in excelsheet and want to perform some operation,second time if call same action it should login with second values in excelsheet

2 Answers   TCS,


Which conditional statement is the most convenient one to use in the case of multiple conditions in the vbscript language?

0 Answers  


How many types of procedures are available in the vbscript language?

0 Answers  


What is the event handling in vbscript?

0 Answers  


int a=4857 i need output as 7584.without using any inbuild function?

6 Answers   Aspire,


Write a VB Script to count blank Lines in a notepad

2 Answers   IBM,


write a script to count no drives in file systems in qtp?

1 Answers   Mind Q Systems,


a function that takes an integer array as an argument and returns the largest value in the array. Use the function in a program

1 Answers  


Categories