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

  • SEARCH
  • Home
  • 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 3334416
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T23:54:10+00:00 2026-05-17T23:54:10+00:00

Using ActiveX – FileSystemObject I would like to: – Open an existing file –

  • 0

Using ActiveX – FileSystemObject I would like to:
– Open an existing file
– Read the first 28 bytes from it and store them in var str1
– Read the next 1000 bytes from it and store them in var str2
– Create a new file with this content: str1 + text_param + str2

This is my Javascript code:

function exportFile(text)
{   
    var fso, f2;
    fso = new ActiveXObject("Scripting.FileSystemObject");
    f2 = fso.OpenTextFile("C:\\default.js",1)
    var str1=f2.Read(28);
    f2.Skip(28);
    var str2=f2.Read(1000);
    f2.Close;
    f2.CreateTextFile("C:\\new.js",true);
    f2.Write(str1+text+str2);
}

But it doesn’t work. I get this error message (in Spanish), refering to the line of the f2.Close. It says, literally, “The object does not accept this property of method”. I tried removing this line and the error goes to the next line (CreateTextFile).

Could you help me? THANKS

Detalles de error de página web

Agente de usuario: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; InfoPath.2; .NET CLR 3.5.30729; .NET CLR 3.0.30729; OfficeLiveConnector.1.5; OfficeLivePatch.1.3; .NET4.0C; .NET4.0E; MS-RTC LM 8)
Fecha: Sun, 7 Nov 2010 11:37:07 UTC


Mensaje: El objeto no acepta esta propiedad o método
Línea: 69
Carácter: 5
Código: 0
URI: file:///C:/freeEdition.html
  • 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-05-17T23:54:10+00:00Added an answer on May 17, 2026 at 11:54 pm

    You’re missing the () after f2.close.

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

Sidebar

Related Questions

I am looking for a reference that covers using ActiveX to open and manipulate
Without resorting to using an ActiveX or some other kind of client side coding:
I'm working on the creation of an ActiveX EXE using VB6, and the only
I have an ActiveX control written using the MS ATL library and I am
Is is possible to create COM component and ActiveX controls in .Net (using c#
I am creating an ATL 8.0 based ActiveX control in C++ using Visual Studio
Ok, so here is the scenario: I have an activeX that uploads files using
I am creating a store using Active Merchant and PayPal sandbox right now. It
I'm looking at moving my application from using active directory membership provider to using
We are running a website using Active Server Pages & COM+ components . The

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.