1

I have a very simple script that merges all .txt files in a folder, as bellow:

copy /b *.txt Merged_output.txt >nul

This does the job and doesn't print anything and this is ok (I don't want it to print the name of every file it merges)

But I would like to see that script is still running until it ends merging all the .txt files. I have a lot o files to merge (8000+) and this takes some time, and I have no idea if it still runs.

I was thinking of creating another batch script having a loop, that prints over and over again this message: Running... Something as bellow:

@echo off
cls
:start
cls
echo Running...
goto start

I was wondering if it is possible to start from the Loop Script, printing the Running message and make it stop after it runs the merging.bat script and after the merging finishes.

Any other suggestions would be most appreciated.

1

1 Answer 1

2

You don't need another batch file. Instead of hiding the output, mask it

@echo off
    setlocal enableextensions disabledelayedexpansion

    set monitor=cmd /q /v /e /c"for /l %%a in () do set/p.=&&echo !time! working || exit"

    copy /b *.txt merged_output | %monitor%
    echo %time% done 

It just pipes the output of the copy command to a separate cmd instance that loops reading each line and printing the current time and the working literal.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.