VB Script to check a file's size on given computer list
-
Friday, March 08, 2013 8:32 AM
Hello everyone,
I'm looking for a VB script that can check a list of computers and give me a report of the file sizes of certain files. In more detail:
- machine list [text] to be checked [I have about 300 machines to check, so this is important]
- files to be checked on all machines in c:\temp\AppInstallLogs\*.txt [they all have the same name, but it contains the hostname, hence the *]
- export file sizes to a report file [even individual would be fine, it's not that important]
To be honest, my scripting skills are lousy but I can adapt basic scripts to fit my needs, so I'll be very grateful for any help / hints you can give me.
Thanks in advance :)
All Replies
-
Friday, March 08, 2013 9:04 AM
Here's a command line that can be pasted into a command prompt window (an administrator's one).
FOR /F "usebackq tokens=1 delims=" %i in ("%userprofile%\Desktop\ComputerName.txt") do dir "\\%i\c$\temp\AppInstallLogs\*.txt" >>"%userprofile%\desktop\FileSizes.txt"
David Candy
- Marked As Answer by IamMredMicrosoft Employee, Owner Friday, May 17, 2013 2:31 AM
-
Friday, March 08, 2013 10:15 AM
You could use David's console command, or put it inside a batch file to automate the process, or check the Script Repository (see top of the page) for similar examples that you then adapt for your environment.To be honest, my scripting skills are lousy but I can adapt basic scripts to fit my needs, so I'll be very grateful for any help / hints you can give me.
Thanks in advance :)
- Marked As Answer by IamMredMicrosoft Employee, Owner Friday, May 17, 2013 2:31 AM

