Here is how I would go about it. There may be an easier way to get the profile list or folder size, but these are the methods that first pop into my head.

Just change the first line to point to whatever text file you want it to be saved in.
(Warning, it overwrites existing data, so make sure you dont point to a file thats important.)

 Code:
$logFile = @ScriptDir+"\Profile Sizes.txt"

$userDir = "%USERPROFILE%"
$profilesDir = SubStr($userDir, 1, InStrRev($userDir, "\"))
$profiles = DirList($profilesDir, 3)

$nul = RedirectOutput($logFile, 1)

For Each $profile in $profiles
   If Right($profile, 1) = "\"
      ? $profile
      ? "--------------------"
      ? "Desktop Size:   "+FormatNumber(fnGetFolderProp($profile+"Desktop","Size"), 0)
      ? "Documents Size: "+FormatNumber(fnGetFolderProp($profile+"My Documents","Size"), 0)
      ? ?
   Endif
Next

$nul = RedirectOutput("")


Function fnGetFolderProp($sFldr,$sProp)
    Dim $objFSO, $objFldr, $nul
    $objFSO = CreateObject("Scripting.FileSystemObject")
    If Not VarType($objFSO)=9 Exit 1 EndIf
    $objFldr = $objFSO.GetFolder($sFldr)
    If Not VarType($objFldr)=9 Exit 3 EndIf
    $nul=Execute("$$fnGetFolderProp = $$objFldr."+$sProp)
    If VarType($fnGetFolderProp)=0 Exit 87 EndIf
EndFunction

Function dirlist($dirname, optional $options)
  dim $filename, $counter, $filepath, $mask
  dim $list, $sublist, $subcounter
  $counter=-1
  $dirname=trim($dirname)
  if $dirname=''
    $dirname=@CURDIR
  endif
  if right($dirname,1)='\'
    $dirname=left($dirname,len($dirname)-1)
  endif
  if getfileattr($dirname) & 16
    $mask='*.*'
  else
    $mask=substr($dirname,instrrev($dirname,'\')+1)
    $dirname=left($dirname,len($dirname)-len($mask)-1)
  endif
  redim $list[10]
  $filename=dir($dirname+'\'+$mask)
  while $filename<>'' and @ERROR=0
    if $filename<>'.' and $filename<>'..'
      select
      case (getfileattr($dirname+'\'+$filename) & 16)
        if $options & 1
          $counter=$counter+1
          if $options & 2
            $list[$counter]=$dirname+'\'+$filename+'\'
          else
            $list[$counter]=$filename+'\'
          endif
        endif
        if ($options & 4)
          $sublist=dirlist($dirname+'\'+$filename+'\'+$mask,$options)
          if ubound($sublist)+1
            redim preserve $list[ubound($list)+ubound($sublist)+1]
            for $subcounter=0 to ubound($sublist)
              $counter=$counter+1
              if $options & 2
                $list[$counter]=$dirname+'\'+$filename+'\'+$sublist[$subcounter]
              else
                $list[$counter]=$filename+'\'+$sublist[$subcounter]
              endif
            next
          endif
        endif
      case ($options & 2)
        $counter=$counter+1
        $list[$counter]=$dirname+'\'+$filename
      case 1
        $counter=$counter+1
        $list[$counter]=$filename
      endselect
      if $counter mod 10
        redim preserve $list[$counter+10]
      endif
    endif
    $filename = dir('')
  loop
  if $counter+1
    redim preserve $list[$counter]
  else
    $list=''
  endif
  if $mask<>'*.*' and ($options & 4)
    $filename=dir($dirname+'\*.*')
    while $filename<>'' and @ERROR=0
      if $filename<>'.' and $filename<>'..'
        if (getfileattr($dirname+'\'+$filename) & 16)
          $sublist=dirlist($dirname+'\'+$filename+'\'+$mask,4)
          if ubound($sublist)+1
            redim preserve $list[ubound($list)+ubound($sublist)+1]
            for $subcounter=0 to ubound($sublist)
              $counter=$counter+1
              if $options & 2
                $list[$counter]=$dirname+'\'+$filename+'\'+$sublist[$subcounter]
              else
                $list[$counter]=$filename+'\'+$sublist[$subcounter]
              endif
            next
          endif
        endif
      endif
      $filename = dir('')
    loop
  endif
  if $counter+1
    redim preserve $list[$counter]
  else
    $list=''
  endif
  $dirlist=$list
endfunction


Edited by ShaneEP (2013-10-31 04:46 PM)