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

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

Write a function for Instr(). We need to write a function that works as same as Instr(). Code or Even pseudo code is good enough for me.?

2034


Which operator can be used to change the value of the operand or change the state of the condition?

579


Explain the operator precedence in vb script?

656


why variable name should not exceed 255 characters?

1822


Why is error handling required?

576






What is event handling in vbscript?

603


What is the extension of the vbscript file?

553


Explain the string concatenation function in vbscript?

544


hi what is called GUI in QTP 8.2 and how can we test the apllication using GUI?

1788


Which object is used to work with the database in the vbscript language and what statement is used to create this object?

510


What are keywords in the vbscript language?

527


Which respective symbols are used to separate a line and to break the lengthy statement into multiple statements in the vbscript language?

803


What are the rules to name variable in vbscript?

587


1. How do declare public variable in vb scripts?

1579


Mention how you can call vbscript functions?

585