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

What are the 2 ways to pass a value to the function?

597


while using Keyward driven framework in QTPif new requirements are added how to manage it...plz ans

1671


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

590


What are subprocedures in vbscript?

755


Mention the environments where vbscript could be run?

771






Explain about scrrun.dll in vbscript?

757


How to use QTP Object in .vbs(vbscript file) file Ex: Browser().., wait(), exist() and etc...

3003


Explain the string concatenation function in vbscript?

611


How will you reverse a string in vbscript?

703


How to capture a runtime error in vbscript?

714


Description.Create

2229


How will you get the natural logarithm of the given number in vbscript?

686


How to Enter Values on the Command promt using VB script

1616


What are lbound and ubound in the vbscript language?

703


Explain few date functions in vbscript?

697