1

I'm making a batch script, but I don't know on how to make a real time progress bar for copying a large file.

Could you help me out?

I'd rather use the standard COPY in batch file, not XCOPY or ROBOCOPY.

My current code is (not all of it):

copy %userprofile%\desktop\target.ipsw %TMP%\downgrade\target.ipsw
Mofi
  • 46,139
  • 17
  • 80
  • 143
hacks4live
  • 33
  • 2
  • 5
  • 7
    What let's you believe it is possible at all? Short answer there is no way to do it in batch, once the copy command is invoked batch has no control over it. –  Jul 06 '18 at 16:54
  • 1
    in other words: do you want to modify the behavior of `copy` command, that is programmed inside `cmd.exe` file? Good luck with that... **`:/`** – Aacini Jul 06 '18 at 17:12
  • 1
    Does the progress indicator in `ROBOCOPY` not meet your need? It may not be what you want, but the answer to this question might work for you. https://stackoverflow.com/questions/2434133/progress-during-large-file-copy-copy-item-write-progress – lit Jul 06 '18 at 18:02
  • ...and your command really should read `Copy "%UserProfile%\Desktop\target.ipsw" "%TMP%\downgrade"` anyhow, _with or without the `/Y` option_. Although I'd choose `RoboCopy` for any file of that size, regardless. – Compo Jul 06 '18 at 19:24

1 Answers1

0

The Esentutl /y option allows copyng (single) file files with progress bar like this :

enter image description here

For the sake of your directories, this is what the code will look like:

esentutl /y "%userprofile%\desktop\target.ipsw" /d "%TMP%\downgrade\target.ipsw" /o

Please keep in mind that there are a few limitations to the esentutl command:

  • You can only copy one file at a time.
  • The /y syntax was presented in windows vista.
  • You cannot overwrite files. (You will have to have batch check the destination beforehand and if needed, delete the previous file)
John Kens
  • 1,615
  • 2
  • 10
  • 28