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
How can constants be declared in the vbscript language?
wat is the com(common object model)object for mozilla firefox???????plz if any one know the exact answer....reply me......
Hi, Can anyone please send me vb script examples to practice vb and also material to learn vb scripting in QTP? my email id : hareen_11@yahoo.com
Explain the operator precedence in vb script?
Which in-built functions are used to convert the specified expression in the form of date and string in the vbscript language?
How to find the font in qtp. Scenario:After entering the username and passwd you will be navigate into the "welcome:Username" page.Now I want to extarct font for this message.
what is the object hyrarchy in QTP for a web based application
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
What is sql loader? Explain the files used by sql loader to load file?
how to set one column as primary key in QTP and fetch values accordingly
what is diff between static and dynaic arrys?
What are the different types of operators and their order of precedence?
Is VB Script Case sensitive or Case insensitive?
Which function is used in the vbscript language to convert the specified expression into a date type value?
What is the use of the recordset object and which statement is used to create such an object?