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

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

785


Hai this is sheik, i want to learn VB scripts for web application pls guide me what are all basic things need to know to learn VB scripts in web application.

1603


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

693


What is the technology used by vb script?

707


Which data type/types are supported by vbscript language and what are their specialties?

787






please can you help me to get a code of flames using a visual basic 6

1407


Explain the operator precedence in vb script?

817


What are the 2 ways in which a variable can be declared in the vbscript language?

769


What is the use of the ‘open’ method to work with the database in the vbscript language and what connection string is passed in the same and what is its usage?

692


wat is the com(common object model)object for mozilla firefox???????plz if any one know the exact answer....reply me......

1652


Why to use option explicit in vb script?

784


Does VB/Win make standalone .EXE files?

3101


How will you check that a variable is an array in vbscript?

723


how to operate webobjects in a webpage using getobject function and then using generic methods?

2777


what do you mean .ota mobile format

2154