Create a file system object to do the following

i. Create a folder

ii. Create a text file in the folder

iii. Update text file with some tex

Answers were Sorted based on User's Feedback



Create a file system object to do the following i. Create a folder ii. Create a text file in t..

Answer / usha

set fso=createobject("scripting.filesystemobject")

set f= fso.createfolder("C:UserssingarsyDesktopusha")

set file= f.createTextFile("abc.txt",2)

file.write("masdkmas.........")

Is This Answer Correct ?    1 Yes 0 No

Create a file system object to do the following i. Create a folder ii. Create a text file in t..

Answer / saravanan_jasmin

set objF=CreateObject("Scripting.FileSystemObject")
Set objW = WScript.CreateObject("WScript.Shell")
curr = objW.CurrentDirectory
path=curr&"folder"
txtpath=path&" extfile.txt"
objF.CreateFolder(path)
objF.CreateTextFile(txtpath)

set objWrite=objF.OpenTextFile(txtpath,2)
objWrite.Write("someText")

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More VB Script Interview Questions

i have developed the below QTP script to count the no of items available in the web list "Select a product" in www.bankrate.com and also want to print what are the items??? can any one help me to rectify the below script??? SystemUtil.Run "iexplore.exe","www.bankrate.com" a=Browser("title:=Mortgage Rates Credit Cards Refinance Home CD Rates by Bankrate.com").page("title:=Mortgage Rates Credit Cards Refinance Home CD Rates by Bankrate.com").Weblist("name:=select").GetTOProperty("items count") msgbox a Dim List() ReDim List(a-1) For i = 1 To a List(i-1)=Browser("title:=Mortgage Rates Credit Cards Refinance Home CD Rates by Bankrate.com").page ("title:=Mortgage Rates Credit Cards Refinance Home CD Rates by Bankrate.com").Weblist("name:=select").GetItem(i) Print List(i-1) Next

1 Answers  


How can you have different number of cells for each row of a table in HTML?

2 Answers  


What is the use of option explicit in vbscript?

0 Answers  


how to add the shared repository file to the script file while running the script manuall

2 Answers  


Differentiate javascript and vbscript?

0 Answers  






did any one attended interview in applabs if you had gone through plz tell me the procedure

0 Answers  


What are lbound and ubound in the vbscript language?

0 Answers  


How can I write HTML text to the window in VB Script?

2 Answers  


How to pass argument by reference to a function in vbscript?

0 Answers  


What is sql loader? Explain the files used by sql loader to load file?

0 Answers  


how to write basic programs in VB Script like addition, multiplication?

14 Answers  


accept a string & display whether a is present or not

1 Answers  


Categories