Batch file commands and progress bar

Discussion in 'Scripting' started by Mvp77, Feb 26, 2018.

  1. Mvp77

    Mvp77 MDL Novice

    Joined:
    May 16, 2016
    Messages:
    33
    Likes Received:
    4
    Trophy Points:
    0
    Coding a standalone progress bar is really easy, but how to code a bar that shows a command progress percentage?
    I don't know, maybe using the "copy" command...
     
  2. s1ave77

    s1ave77 Has left at his own request

    Joined:
    Aug 15, 2012
    Messages:
    16,130
    Likes Received:
    24,279
    Trophy Points:
    340
    Found a lot of 'examples' but none of them is working properly. Afaik it's not possible :g:.
     
  3. Tito

    Tito Super Mod / Adviser Staff Member

    Joined:
    Nov 30, 2009
    Messages:
    17,888
    Likes Received:
    16,542
    Trophy Points:
    340
  4. Mvp77

    Mvp77 MDL Novice

    Joined:
    May 16, 2016
    Messages:
    33
    Likes Received:
    4
    Trophy Points:
    0
  5. s1ave77

    s1ave77 Has left at his own request

    Joined:
    Aug 15, 2012
    Messages:
    16,130
    Likes Received:
    24,279
    Trophy Points:
    340
    OK: counter != progress bar :D.

    There are several commandline tools that show a bar, wget being another example, still the functionality seems to come only with these tools. So far i never found any CMD code that was working properly :g:.
     
  6. Flipp3r

    Flipp3r MDL Expert

    Joined:
    Feb 11, 2009
    Messages:
    1,743
    Likes Received:
    772
    Trophy Points:
    60
    In the early versions of this project: https://forums.mydigitallife.net/threads/oem-recovery-partition-creator-for-windows.21978/ AnarethoS used a file he created in AuditIT that would give you a percentage with progress bar
    while running his batch file. ie, unpacking install.wim with imagex.
    He may still have this. You could also Google "autoit progress bar". examples come up, even in youtube...

    I think he stopped using it once he changed to dism...
     
  7. Mvp77

    Mvp77 MDL Novice

    Joined:
    May 16, 2016
    Messages:
    33
    Likes Received:
    4
    Trophy Points:
    0
    #7 Mvp77, Feb 27, 2018
    Last edited: Feb 27, 2018
    (OP)
    I created a batch to automate different deployment tasks and I would like to add a progress bar for some commands.
    If it is not possible I switch to Powershell.
    I'm not interested in other solutions (AutoIt, wget...).
    Sorry... :)
     
  8. Flipp3r

    Flipp3r MDL Expert

    Joined:
    Feb 11, 2009
    Messages:
    1,743
    Likes Received:
    772
    Trophy Points:
    60
    AutoIT compiles an executable file you can use in your batch.
    ie,
    Code:
    @echo off
    PBar.exe dism /Apply-Image /Imagefile:R:\Install.wim /index:1 /ApplyDir:W:\
     
  9. Mvp77

    Mvp77 MDL Novice

    Joined:
    May 16, 2016
    Messages:
    33
    Likes Received:
    4
    Trophy Points:
    0
    Maybe it's better using robocopy... :)
     
  10. sebus

    sebus MDL Guru

    Joined:
    Jul 23, 2008
    Messages:
    6,201
    Likes Received:
    1,945
    Trophy Points:
    210
    Something like here maybe?
     
  11. KNARZ

    KNARZ MDL Addicted

    Joined:
    Oct 9, 2012
    Messages:
    896
    Likes Received:
    475
    Trophy Points:
    30
    take a look at: esentutl.exe (built in)

    e.g. esentutl.exe /y "%~1" /d "%~2" /o
     
  12. Mvp77

    Mvp77 MDL Novice

    Joined:
    May 16, 2016
    Messages:
    33
    Likes Received:
    4
    Trophy Points:
    0
    Thanks to all of you for tips and suggestions, but I'm really tired of Microsoft... now I need a rest. :)
    Anyway, it seems really hard to link a progress bar to any command.
    PowerShell should be the evolution of the old batch (or the solution to the old problems).
    But did you wonder why nobody uses it...? (Maybe because it's even worse...)
    Also, the only idea of recoding everything makes me feel bad... and for what? a bar? looolll...
    But why in this world even the easiest thing become impossible?