+ Post New Thread
Results 1 to 5 of 5
Windows Thread, Scan and report file size and age in Technical; Looking to get some data on files that have not been used in over three years and also report on ...
  1. #1
    HMCTech's Avatar
    Join Date
    Apr 2008
    Posts
    618
    Thank Post
    37
    Thanked 48 Times in 35 Posts
    Rep Power
    23

    Scan and report file size and age

    Looking to get some data on files that have not been used in over three years and also report on what size file they are. Has anyone done anything similar?

  2. #2

    Join Date
    Mar 2008
    Location
    Medway, Kent
    Posts
    130
    Thank Post
    23
    Thanked 28 Times in 25 Posts
    Rep Power
    18
    robocopy can create a file to tell you this it can also move the files, have a look at this thread Keeping Staff Shared Drives Clean?

  3. #3

    dhicks's Avatar
    Join Date
    Aug 2005
    Location
    Knightsbridge
    Posts
    5,647
    Thank Post
    1,256
    Thanked 781 Times in 678 Posts
    Rep Power
    236
    Quote Originally Posted by AlexPilot View Post
    Looking to get some data on files that have not been used in over three years and also report on what size file they are. Has anyone done anything similar?
    Yes, just recently - our Windows 2003 didn't have Python available, so this is written in VBS:

    Code:
    Dim fso, folder, sFolder
    
    Set fso = CreateObject("Scripting.FileSystemObject")
    
    Function createSpacer(inputValue)
      if inputValue = 0 Then
        inputValueDiv = 1
      Else
        inputValueDiv = inputValue
      End If
      spacer = ""
      Do Until inputValueDiv >= 100000000000
        spacer = spacer & " "
        inputValueDiv = inputValueDiv * 10
      Loop
      createSpacer = spacer
    End Function
    
    Function listDir(path, folder, depth)
      Dim result
      Set result = CreateObject("Scripting.Dictionary")
      result.Add "totalSize", 0
      result.Add "lastModified", 0
      If depth <> 0 Then
        result.Item("lastModified") = folder.DateLastModified
      End If
      For each folderIdx In folder.Files
        filename = path & "\" & folderIdx.Name
        Set fileObject = fso.GetFile(filename)
        fileSize = fileObject.Size
        fileModified = fileObject.DateLastModified
        If fileModified > result.Item("lastModified") Then
          result.Item("lastModified") = fileModified
        End If
        wscript.echo(fileSize & createSpacer(fileSize) & fileModified & " " & fileName)
        result.Item("totalSize") = result.Item("totalSize") + fileSize
      Next
    
      For each folderIdx In folder.SubFolders
        If folderIdx.Name <> "System Volume Information" Then
          Set subFolderResult = listDir(path & "\" & folderIdx.Name, folderIdx, depth+1)
        End If
        wscript.echo(subFolderResult("totalSize") & createSpacer(subFolderResult("totalSize")) & subFolderResult.Item("lastModified") & " " & path & "\" & folderIdx.Name)
        result.Item("totalSize") = result.Item("totalSize") + subFolderResult.Item("totalSize")
      Next
      Set listDir = result
    End Function
    
    
     
    
    sFolder = wscript.Arguments.Item(0)
    If sFolder = "" Then
        Wscript.Echo "No Folder parameter was passed"
        Wscript.Quit
    End If
    
    listDir sFolder, fso.GetFolder(sFolder + "\"), 0

  4. #4

    plexer's Avatar
    Join Date
    Dec 2005
    Location
    Norfolk
    Posts
    13,660
    Thank Post
    657
    Thanked 1,624 Times in 1,453 Posts
    Rep Power
    422
    What version of windows?

    FSRM on 2008 gives you options to look at different attributes and then perform a task such as move them.

    Ben

  5. #5
    simpsonj's Avatar
    Join Date
    Apr 2009
    Location
    Oxford
    Posts
    386
    Thank Post
    160
    Thanked 66 Times in 55 Posts
    Blog Entries
    8
    Rep Power
    22
    Treesize will do that, free version on every copy of PC Pro for the past year or so will do the job.

SHARE:
+ Post New Thread

Similar Threads

  1. Text size in Report Assist 2009
    By TechSupp in forum Educational Software
    Replies: 2
    Last Post: 28th November 2012, 07:38 PM
  2. File Size Quota
    By wesleyw in forum How do you do....it?
    Replies: 3
    Last Post: 18th May 2010, 12:13 PM
  3. [MS Office - 2007] .docx file size bloat when printing file with multiple pictures.
    By pete in forum Office Software
    Replies: 5
    Last Post: 29th April 2010, 10:03 AM
  4. Swap file size
    By paulgarratt83 in forum Thin Client and Virtual Machines
    Replies: 1
    Last Post: 31st July 2009, 03:14 PM
  5. File size
    By imiddleton25 in forum Virtual Learning Platforms
    Replies: 2
    Last Post: 24th June 2008, 11:06 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •