Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8423487
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T03:44:10+00:00 2026-06-10T03:44:10+00:00

Hi this might sound weird, below is my VB Code Const ForReading = 1,

  • 0

Hi this might sound weird, below is my VB 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

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 ?

EDIT:

I figured it out, had to close the file first and then display the filesize.size for XP to display the proper file size.

Still don’t know why this works on windows 7 … any thoughts ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T03:44:12+00:00Added an answer on June 10, 2026 at 3:44 am

    My best guess would be a change to file caching between the two versions of windows or the FileSystemObject

    http://msdn.microsoft.com/en-us/library/windows/desktop/aa364218%28v=vs.85%29.aspx

    According to http://msdn.microsoft.com/en-us/library/z9ty6h50%28v=vs.84%29.aspx

    The Close method flushes the buffer and closes the file.

    So the XP version isn’t seeing the file size until the IO is flushed to the disk.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This might sound like a weird idea and I haven't thought it through properly
Um, this might sound a bit weird. We were having some problems with a
this might sound weird :) i want to call a file( test_2.php ) i.e
OK so this might sound a bit weird! The thing is that in a
This might sound like a silly question but how would I make this code
This might sound weird, but when I open a solution that I dont know,
it might sound weird when I post this, How do i combine jQuery UI
This might sound silly but i'm having trouble printing a variable in this code
This question might sound weird, but how do I make a job fail? I
This might sound kind of weird, but I have a query that joins two

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.