title: File Size in VB for Windows XP
body: <p>Hi this might sound weird, below is my VB Code</p>
  
  <pre><code>Const ForReading = 1, ForWriting = 2, ForAppending = 8
  
  Set filesys = CreateObject("Scripting.FileSystemObject")
  'Set fileapp = filesys.OpenTextFile("C:\TEST.txt", ForAppending, True) 
  Set filewrt = filesys.OpenTextFile("C:\TEXT.txt", ForWriting, True) 
  Set filesize = filesys.GetFile("C:\TEXT.txt")
  
  
  filewrt.Write("HELOOO")
  msgbox filesize.size
  filewrt.close
  </code></pre>
  
  <p>This script shows the value '6' for 6bytes as the file size in Windows 7 but in XP it shows 0 even though the file size is 6 bytes .... any ideas ?</p>
  
  <p>EDIT:</p>
  
  <p>I figured it out, had to close the file first and then display the filesize.size for XP to display the proper file size.</p>
  
  <p>Still don't know why this works on windows 7 ... any thoughts ?</p>