Note: Forums will be making significant UX changes to address key usability improvements surrounding search, discoverability and navigation. To learn more about these changes please visit the announcement which can be found HERE.
VB Script to check a file's size on given computer list

Answered 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
     
     Answered

    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

  • Friday, March 08, 2013 10:15 AM
     
     Answered

    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 :)
    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.