FileSystemObject
Set fso = CreateObject("Scripting.FileSystemObject")
check = fso.folderexists("F:\chandu")
msgbox check
If check Then
msgbox "folder exist"
fso.CreateTextFile("F:\chandu\cad.txt")
Set mywrite = fso.OpenTextFile("F:\chandu\cad.txt",2)
mywrite.Write("some text")
else
fso.createfolder("F:\chandu")
msgbox "folder created"
End If
Set fso = CreateObject("Scripting.FileSystemObject")
check = fso.folderexists("F:\chandu")
msgbox check
If check Then
msgbox "folder exist"
fso.CreateTextFile("F:\chandu\cad.txt")
Set mywrite = fso.OpenTextFile("F:\chandu\cad.txt",2)
mywrite.Write("some text")
else
fso.createfolder("F:\chandu")
msgbox "folder created"
End If
No comments:
Post a Comment