how to write in an xml file using vbscript??? I want to print the size and type of various files into an xml file and list it. how do I do it?
for example: folder E has 3 files. so wanna write a program such tht the program checks folder E, and lists the size and type of all files in it to an xml file
pls help
below is the program I have written to copy all the files of a folder to a text file.. but I want to copy to an xml
Option Explicit
Dim objFSO,objf,objfolder, objFile, strFileProperties, strFiles,OBJFLD,objfile2
dim objf1,objfile1,objtextfile,strfolderproperties,objsubfld
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objf= objFSO.Getfolder("C:\Test")
set OBJFLD=objf.subfolders
for each objfolder in OBJFLD
strFolderproperties = strFolderproperties & "Number of files: " & objFolder.Files.Count & VbCrLf
set objfile2=objfolder.files
for each objfile in objfile2
' Display generel file properties
strFileProperties = strFileProperties & "File name: " & objFile.Name & VbCrLf
strFileProperties = strFileProperties & "File path: " & objFile.Path & VbCrLf
strFileProperties = strFileProperties & "File size: " & objFile.Size & " bytes" & VbCrLf
strFileProperties = strFileProperties & "File type: " & objFile.Type & VbCrLf & vbcrlf
next
next
set objf1=objfso.getfolder("E:\logs3")
set objfile1=objfso.getfile( "E:\logs3\database.txt")
set objf1=nothing
set objfile1=nothing
set objtextfile=objfso.opentextfile("E:\logs3\database.txt",8,true)
objtextfile.writeline(strfileproperties)
objtextfile.close
set objf1=objfso.getfolder("E:\logs3")
set objfile1=objfso.getfile( "E:\logs3\database.txt")
set objf1=nothing
set objfile1=nothing
set objsubfld=objfso.opentextfile("E:\logs3\database.txt",8,true)
objsubfld.writeline(strfolderproperties)
objsubfld.close