How to run hypermesh in batch mode

JoaoGunther
JoaoGunther Altair Community Member

I developed a script to setup a simulation and run it with the python API, but I am struggling to run it in batch mode.

I copied the code from this post but it does not work for me. When I run it in CMD it just doesn't do anything

Here is the code I am using in CMD:

"C:\Arquivos de Programas\Altair\2025\hwdesktop\hwx\bin\win64\runhwx.exe" -cfg -client HyperWorksDesktop -plugin HyperworksPost -profile HyperworksPost -f C:\Users\joaog\Desktop\Udesc\TCC\Codigo Hypermesh deu certo agora vai\Main_Agora_Vai.py -b

Best Answer

  • Michael Herve
    Michael Herve
    Altair Employee
    Answer ✓

    Hello again,

    can you please call HyperMesh directly (without the launcher)?


    "C:\WORK\DevBuilds\2025.0.0.24\hwdesktop\hwx\bin\win64\runhwx.exe" -client HyperWorksDesktop -plugin HyperworksGeneral -profile HyperworksGeneral -l en -startwith HyperMesh -f "C:\Temp\batch_args_sysargv.py"

    If this not enough, can you please create a support request with your script so that my colleagues can investigate further?

    Regards,

    Michael

Answers

  • Michael Herve
    Michael Herve
    Altair Employee
  • JoaoGunther
    JoaoGunther Altair Community Member

    Thank you for your response!

    I managed to run it from the CMD with this command:

    "C:\Program Files\Altair\2025\hwdesktop\hwx\bin\win64\runhwx.exe" -client HyperWorksDesktop -plugin HyperworksLauncher -profile HyperworksLauncher -l en -startwith HyperMesh -f "C:\Users\joaog\Desktop\Udesc\TCC\Codigo Hypermesh deu certo agora vai\Main Agora Vai.py"

    But when I add -b to run it in batch mode it still doesn't do anything.

  • Michael Herve
    Michael Herve
    Altair Employee

    Hello @JoaoGunther ,

    in your command line I see your Python file is inb

    C:\Users\joaog\Desktop\Udesc\TCC\Codigo Hypermesh deu certo agora vai\Main Agora Vai.py

    What if you remove all spaces and replace it with underscore instead?

    Regards,

    Michael

  • JoaoGunther
    JoaoGunther Altair Community Member

    I just ran a few tests. Replacing spaces with underscores, with and without -b.

    Without -b it opens hypermesh as usual and runs my code without any issues.

    But with -b in any position in the command line like below it starts hypermesh (I can see it in the task manager) but closes soon after.

    "C:\Program Files\Altair\2025\hwdesktop\hwx\bin\win64\runhwx.exe" -client HyperWorksDesktop -plugin HyperworksLauncher -profile HyperworksLauncher -l en -startwith HyperMesh -b -f "C:\Users\joaog\Desktop\Udesc\TCC\Codigo_Hypermesh_deu_certo_agora_vai\Main_Agora_Vai.py"

  • Michael Herve
    Michael Herve
    Altair Employee
    Answer ✓

    Hello again,

    can you please call HyperMesh directly (without the launcher)?


    "C:\WORK\DevBuilds\2025.0.0.24\hwdesktop\hwx\bin\win64\runhwx.exe" -client HyperWorksDesktop -plugin HyperworksGeneral -profile HyperworksGeneral -l en -startwith HyperMesh -f "C:\Temp\batch_args_sysargv.py"

    If this not enough, can you please create a support request with your script so that my colleagues can investigate further?

    Regards,

    Michael

  • JoaoGunther
    JoaoGunther Altair Community Member

    Thank you for your help, Michael! It is working now

  • William Kuo_21386
    William Kuo_21386 Altair Community Member

    Hi!

    I am running into the same issue but these suggestions have not helped. I am running Hypermesh 2025.

    "C:/Program Files/Altair/2025/hwdesktop/hwx/bin/win64/runhwx.exe" -client HyperWorksDesktop -plugin HyperworksGeneral -profile HyperworksGeneral -l en -startwith HyperMesh -f D:\hmTempFile.py -b

    When I run it without -b, it runs in hypermesh and my scripts executes it just fine.

    But with -b, my script does not run and doesn't even show up on task manager.