Write down the file name, file size in MB and last modified date
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.
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
[ + ] Show comments
Answers (2)
Please log in to answer
Posted by:
captain_planet
13 years ago
That's easy....
Use a vbscript similar to the following, which will enable you to enumerate files in the windows folder:
http://technet.microsoft.com/en-us/library/ee198703.aspx
Then Google for 'FileSystemObject' and the following properties:
OpenTextFile
DateLastModified
Name
Size
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.
Use a vbscript similar to the following, which will enable you to enumerate files in the windows folder:
http://technet.microsoft.com/en-us/library/ee198703.aspx
Then Google for 'FileSystemObject' and the following properties:
OpenTextFile
DateLastModified
Name
Size
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.
Posted by:
itolutions
13 years ago
Also you can use commandline:
to get info in format:
VbScript:
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
VbScript:
Dim oShell
Set oShell = WScript.CreateObject ("WScript.Shell")
oShell.run "cmd /K dir >> c:\myfile.txt"
Set oShell = Nothing
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.