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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T10:28:59+00:00 2026-06-03T10:28:59+00:00

I have a very small batch script which is extracting a quite amount of

  • 0

I have a very small batch script which is extracting a quite amount of files.
The script is meant to be delivered with the compressed data to other users.

Now my problem is that this compression tool is outputting a ton of data into the cmd window.
I think this will confuse a lot of useser because the output is really “running”. It basically shows a percentage with each line and how it decompressed at which speed (CPU and HDD).
A lot of confusing data that no one needs to see. Now I don’t really like suppressing all the output of the program, giving the user feedback on how far the decompression already got would be important in my opinion.
So is it possible to redirect the output and read just the first three digits of that output and deliver that to the users in a single line? So the users only sees an advancing percantage (in one line) and not 20 new lines every second with all this data?

Here an example of how it looks at the moment:
https://i.stack.imgur.com/guTYP.png
The compression tool is SREP, my OS Win 7 x64.

  • 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-03T10:29:03+00:00Added an answer on June 3, 2026 at 10:29 am

    Here is a simple hybrid batch/JScript script that I think will do what you want.

    show3.bat

    @if (@X)==(@Y) @end /* harmless hybrid line that begins a JScrpt comment
    
    ::: Batch part ::::
    @cscript //nologo //e:JScript "%~f0"
    @exit /b
    
    *** JScript part ***/
    while( !WScript.StdIn.AtEndOfStream ) {
      WScript.StdOut.Write( '\x08\x08\x08' + WScript.StdIn.ReadLine().substr(0,3) );
    }
    WScript.StdOut.WriteLine();
    

    Usage:

    yourCommand | show3
    

    The script could be simplified to pure JScript, but then it won’t be as convenient to use:

    show3.js

    while( !WScript.StdIn.AtEndOfStream ) {
      WScript.StdOut.Write( '\x08\x08\x08' + WScript.StdIn.ReadLine().substr(0,3) );
    }
    WScript.StdOut.WriteLine();
    

    Usage:

    yourCommand | cscript //nologo show3.js
    

    EDIT As jeb commented, you should not need any redist to use this solution.

    I’ve taken some of the concepts in jeb’s answer and combined the entire process into one hybrid script. No need for a standalone “show3” file.

    @if (@X)==(@Y) @end /* harmless hybrid line that begins a JScrpt comment
    
    :: ***** Batch part ******
    @echo off
    
    REM whatever batch code you need goes here
    
    yourCommand | cscript //nologo //e:JScript "%~f0"
    
    REM whatever batch code you need goes here
    
    exit /b
    
    ****** JScript part ******/
    while( !WScript.StdIn.AtEndOfStream ) {
      WScript.StdOut.Write( '\x08\x08\x08' + WScript.StdIn.ReadLine().substr(0,3) );
    }
    WScript.StdOut.WriteLine();
    

    yourCommand would be whatever compression command you are using. Based on your comments, it sounds like you might have to use yourCommand 2>&1 if the output you want is printing to stderr instead of stdout.

    I’ve created a “yourCommand.bat” file for testing purposes. It crudely emulates the output behavior you describe for your compression program.

    @echo off
    for /l %%A in (1 1 100) do (
      echo %%A   "I don't want to see this quoted text"
      for /l %%B in (1 1 50000) do rem
    )
    

    Finally, if you really want a pure batch solution, I greatly simplified jeb’s solution. I eliminated the temp file and used a pipe instead.

    @echo off
    if "%~1"==":show3" goto :show3
    REM whatever batch code you need goes here
    
    (yourCommand & echo EOF) | "%~f0" :show3
    
    REM whatever batch code you need goes here
    exit /b
    
    :show3
    setlocal enableDelayedExpansion
    for /f %%a in ('copy /Z "%~dpf0" nul') do set "CR=%%a"
    :read
    set "ln="
    set /p "ln="
    if not defined ln goto :read
    for /f "tokens=1* delims= " %%A in ("!ln!") do if "%%A%%B" equ "EOF" (
      echo(
      exit /b
    )
    <nul set /p "=!ln:~0,3!   !cr!"
    goto :read
    

    Edit – I modified the EOF test to ignore any leading or trailing spaces. This should make the code more robust.

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

Sidebar

Related Questions

I have a very small threaded application, which is collecting small chunks of data
I have a very small amount of data (~200 bytes) that I retrieve from
I have a very small script to get all records from a database table,
I have a very large (~6GB) SVN repository, for which I've written a batch
i have a very small utilty app written in c# that works fine on
I have a very small form where a user can enter their zip code
I have a very small office environment, and my team sends created pdfs to
I have a very small program: public static void main(String[] args) { Queue<String> queue
I have vales with very small difference like... 0.000001. I want to visualize them
I have to multiply a very small sized matrix ( size - 10x10 )

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.