vbscript - How to write file size in kB to text file? -


i have vbscript convert data specific folder (e.g. c:) text file file sizes. problem here is, file size converting bytes instead of kb. idea how can modify script exact file size in kb? below vbscript:

dim fso dim objfolder dim objoutfile dim objfiles dim objfile  'creating file system object set fso = createobject("scripting.filesystemobject")  'getting folder object set objfolder = fso.getfolder("c:\users\user\desktop\folder a")  'creating output file write file sizes set objoutfile = fso.createtextfile("c:\users\user\desktop\identifiying 0 file size kb.txt")  'getting list of files set objfiles = objfolder.files  'writing sizes , path of each file output file each objfile in objfiles     objoutfile.writeline(objfile.size & string(50 - len(objfile.size), " ") & objfile.path) next  objoutfile.close 

divide size 1024 in kb , round value appropriate number of digits (e.g. 2):

for each objfile in objfiles   size = round(objfile.size / 1024, 2)   objoutfile.writeline size & string(50 - len(size), " ") & objfile.path next 

Comments

Popular posts from this blog

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

html - How to style widget with post count different than without post count -

url rewriting - How to redirect a http POST with urlrewritefilter -