我有我的 VBscript,它将数据从特定文件夹(例如 C:) 转换为具有文件大小的文本文件。我的问题是,我的文件大小正在转换为字节而不是 kb。知道如何修改此脚本以获取以 kb 为单位的确切文件大小吗?下面是我的VBscript:
Dim fso
Dim ObjFolder
Dim ObjOutFile
Dim ObjFiles
Dim ObjFile
'Creating File System Object
Set fso = CreateObject("Scripting.FileSystemObject")
'Getting the Folder Object
Set ObjFolder = fso.GetFolder("C:\Users\User\Desktop\Folder A")
'Creating an Output File to write the File sizes
Set ObjOutFile = fso.CreateTextFile("C:\Users\User\Desktop\IDENTIFIYING ZERO FILE SIZE KB.txt")
'Getting the list of Files
Set ObjFiles = ObjFolder.Files
'Writing sizes and Path of each File to Output File
For Each ObjFile In ObjFiles
ObjOutFile.WriteLine(ObjFile.size & String(50 - Len(ObjFile.size), " ") & ObjFile.Path)
Next
ObjOutFile.Close