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 7849857
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T18:39:54+00:00 2026-06-02T18:39:54+00:00

I wrote a script (.js) which should copy all text from one file to

  • 0

I wrote a script (.js) which should copy all text from one file to another, but it doesn’t work (i run it on hard disc):

var fso = new ActiveXObject("Scripting.FileSystemObject");
var myInputTextStream = fso.OpenTextFile("C:\\FILE\\back_log.log", 1, true);
var log = "C:\\Temp\\26_04_2012_16_22_49\\ext.txt";     
    var myOutputTextStream = fso.OpenTextFile(log, 8, true);
    while(myInputTextStream.AtEndOfStream)
        {
      myOutputTextStream.Write(myInputTextStream.ReadAll());
    }
      //myInputTextStream.Close();
      //myOutputTextStream.Close(); 
    WScript.Echo("FINISH!!!");

Could anybody coorrect me (or code=))? Thanks a lot.

  • 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-02T18:39:55+00:00Added an answer on June 2, 2026 at 6:39 pm

    myInputTextStream.AtEndOfStream is false until reading reaches the EOF. Hence your while-loop is never executed.

    If you use ReadAll(), you don’t need the while-loop at all.

    You should also never comment out your Close()-methods, you may get troubles, especially when using portable memory devices like SDI-cards etc.

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

Sidebar

Related Questions

Colls, I wrote a script which should: copy a file from C:\PR\DataFiles\Input\CL_CH5\+k+\ext_028042012.dat to C:\PR\DataFiles\Input\ext_028042012.dat
I wrote a .sh script which should upload data from file by sql*loader and
I'm trying to write a simple bash script which should copy all files with
I wrote this script which counts occurrences of particular pattern in a given file.
I have a script that I wrote in PHP which scrapes data from a
I recently wrote a script which queries PyPI and downloads a package; however, the
I wrote a batch script which recursively updates my source code against the company's
I wrote a perl script a while ago which logged into my online banking
I wrote the following script, which generates a SyntaxError : #!/usr/bin/python print Enter the
I want to write a script which cleans the 'run' dialogue automatically every log

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.