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

Write a Script for ATM in QTP

0 Answers  


What is the difference between ByRef and ByVal. When to use ByRef and ByVal

5 Answers   Polaris, TCS,


Find Out Length of an array without using Ubound?

1 Answers  


What are events in the vbscript language?

0 Answers  


Sub link() Dim k As Integer Dim rand As Integer Dim URL As String Dim foldernum As Integer Dim folderstring As String Dim filenum As Integer Dim filestring As String k = 1 'for AC Numbers For i = 11 To 40 foldernum = 0 foldernum = 1000 + i folderstring = CStr(foldernum) folderstring = Mid(folderstring, 2, 3) folder = "ac" & folderstring 'folderstring = Sheets(2).Cells(i, 1) ' for Number of Random files For j = 1 To 10 rand = Int(Rnd * (200 - 1) + 1) filenum = 0 filenum = 1000 + rand filestring = CStr(filenum) filestring = Mid(filestring, 2, 3) 'URL = "http://ceobihar.nic.in/PSCDROM/ac" & folderstring & "/i" & folderstring & "0" & filestring & ".pdf" URL = "http://www.elections.tn.gov.in/pdfs/dt1/" & folder & "/" & folder & filestring & ".pdf" ' URL =http://www.wb.nic.in/wbeco/EROLLS/PDF/English/A001/a0010105 .pdf Cells(k, 1) = folderstring Cells(k, 2) = folder Cells(k, 3) = filestring Cells(k, 3) = URL k = k + 1 Next j Next i End Sub plz define it

0 Answers  






who will create the object?

0 Answers   TCS,


Can anyone send me a vb script function for verifying the functionality of active links on a web page

0 Answers   Zensar,


How to throw an error in vbscript?

0 Answers  


write a vb script to generate hello 5 times using do until loop

4 Answers  


what is descriptive programming in QTP and what is environment variable in QTP? where we store and what is its use?

4 Answers   Perot Systems,


Mention how to access array data?

0 Answers  


How many types of operators are available in the vbscript language?

0 Answers  


Categories