write a vb script to open a text file and write into it
Answers were Sorted based on User's Feedback
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 |
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 |
What is the difference between for loop and while loop?
explain with example primitive data types of vb script.
Hi Friends Rajendra this is bhavani prasad, iam working Hyderabad. i faced one problem with qtp recording mode i.e in my application there is 100 records first we click the first record that record will be jumped to next session and 99 records will there stop the recording and run the same script .Run this script qtp does not identify the records. So plz tell me what is the solution.
A folder is there inside no of textfiles are avilable. How do count the textfiles. Normally folder means we are using subfolder methods but textfiles is not working for subfolder methods and how do get file name also.
Mention what is the use of option explicit in vbscript?
What is the purpose of the err object in the vbscript language?
For a webbased application:- what should be code in expert veiw, for retrieving a single column name "username" from a server and checking whether exported "username" from datatable doesn't exist in server. suppose i have saved in excelsheet a username="gayatri" , which is exported, then checked for whether this username "gayatri" exist in server database or not ? if exist then allow to enter new username, which should be again checked for in loop , or else come out of loop and enter a distinct "username". plz let me have this answer in my id gayatrisahooin@hotmail.com
Join the multiple array with out using JOIN function
Give examples where vb script can directly run on users system with windows as os?
Hi I don't have any idea on VBscript. can any one point me to a good web site to learn VBscript. Regards lina
sunday is sunday monday tuesday wendesday sunday thursday friday saturday sunday sunday how to count no of sunday in the text file from vb? Answer me asap
Explain about constants in vb script?