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
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 |
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 |
Write a Script for ATM in QTP
What is the difference between ByRef and ByVal. When to use ByRef and ByVal
Find Out Length of an array without using Ubound?
What are events in the vbscript language?
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
who will create the object?
Can anyone send me a vb script function for verifying the functionality of active links on a web page
How to throw an error in vbscript?
write a vb script to generate hello 5 times using do until loop
what is descriptive programming in QTP and what is environment variable in QTP? where we store and what is its use?
Mention how to access array data?
How many types of operators are available in the vbscript language?