i need vbscript for below query.

Write down the file name, file size in MB and last modified date of all files in Windows directory to a text file. The output should be like below. You can format the output using #3 task.
File Name File Size Last Modified Date
Abc.txt 1 MB 01/01/2011
Xyz.exe 0.1 MB 02/01/2011

please Any help on this.
0 Comments   [ - ] Hide Comments


Please log in to comment

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
Answer this question or Comment on this question for clarity


That's easy....

Use a vbscript similar to the following, which will enable you to enumerate files in the windows folder:


Then Google for 'FileSystemObject' and the following properties:


and then once you've shown that you've actually made an effort, there are lots of people here that will help you finish the job.
Answered 07/01/2011 by: captain_planet
Fourth Degree Brown Belt

Please log in to comment
Also you can use commandline:
dir >> c:\myfile.txt
to get info in format:

02.05.2011 17:08 <DIR> %HOMESHARE%
03.02.2011 11:45 <DIR> .gimp-2.4
03.02.2011 11:41 9 814 .recently-used.xbel
14.12.2010 17:57 <DIR> .thumbnails
04.05.2011 14:21 <DIR> Contacts
04.07.2011 13:45 <DIR> Desktop

Dim oShell
Set oShell = WScript.CreateObject ("WScript.Shell")
oShell.run "cmd /K dir >> c:\myfile.txt"
Set oShell = Nothing
Answered 07/04/2011 by: itolutions
Purple Belt

Please log in to comment