Ouvrir un fichier .bat et le laisser affiché à l'écran. [Solved]

Vous voulez de l'aide ? Postez ici :)
Post Reply
AugustusS
Posts: 3
Joined: 22 Jul 2021, 15:41

Ouvrir un fichier .bat et le laisser affiché à l'écran. [Solved]

Post by AugustusS »

Bonjour,

Je tente d'ouvrir un fichier ipconfig_all.bat depuis Actiona, et de laisser la fenêtre cmd ouverte.
Mon fichier ipconfig_all.bat contient le code suivant :

Code: Select all

C:\Windows\system32\cmd.exe /K ipconfig /all
Dans Actiona, j'utilise une action "Commande détachée" contenant :

Code: Select all

C:\Users\User1\Desktop\ipconfig_all.bat
Je pense que le .bat se lance correctement, mais se ferme aussitôt, car je n'ai pas de retour d'erreur de la part d'Actiona.
Si je lance mon .bat depuis le bureau ou depuis Exécuter, tout fonctionne normalement, il n'y a qu'en passant par Actiona que ça fonctionne plus.
J'ai aussi tenté de lancer Actiona avec les droits administrateurs, mais ça n'a rien changé.

Merci d'avance pour vos réponses,

Augustus S.
Last edited by AugustusS on 17 Aug 2021, 07:55, edited 1 time in total.
eureka
Posts: 204
Joined: 08 Mar 2016, 22:18

Re: Ouvrir un fichier .bat et le laisser affiché à l'écran.

Post by eureka »

Mostly I am in Ubuntu 20.04 and i can just run command "gnome-terminal" to launch terminal.
Then I target the terminal window and paste commands into terminal, followed by click to execute.
In Windows 10 I see that "wt" command can be used.

https://devblogs.microsoft.com/commandl ... nd-tricks/

e.g.

command: wt
parameters: -p "PowerShell" -d . ; split-pane -V
AugustusS
Posts: 3
Joined: 22 Jul 2021, 15:41

Re: Ouvrir un fichier .bat et le laisser affiché à l'écran.

Post by AugustusS »

Thank you for your answer, it indeed works using the Windows Terminal. Although, I would like to understood why it doesn't work with cmd and powershell commands. Also, the disadvantage of using wt is that it must be installed before use in Actiona, meaning the .exe cannot be used by everyone.

From my further investigation, it appears that Windows does launch a cmd or powershell terminal, and it remains active in the Task Manager as a background process. It's just that it doesn't load in a window, so I can't do anything with it.
eureka
Posts: 204
Joined: 08 Mar 2016, 22:18

Re: Ouvrir un fichier .bat et le laisser affiché à l'écran.

Post by eureka »

I am back in my comfort zone - Ubuntu 20.04 - but will explore further when I next dual boot into Windows 10.
Meanwhile, another method I use - run a python script using subprocess to run commands and args.

Command: python3
Parameters: /path/to/my/script.py

And sometimes I run an external Actiona script which is dedicated to terminal automation.

Command: actexec
Parameters: /path/to/my/script.ascr
eureka
Posts: 204
Joined: 08 Mar 2016, 22:18

Re: Ouvrir un fichier .bat et le laisser affiché à l'écran.

Post by eureka »

I will add an extra note on how I launched command terminal in Windows 10 (there are a number of ways).

Key: Windows Icon + R
Pause: to allow Run popup to open to receive command "cmd"
Key: c
Key: m
Key: d
Key: Enter
Paste command string into terminal (from variable)
Key: Enter

I keep all my commands in a Code box and use a Multi Data Input box to select from list of commands (as variables).
Or you can hold them in an ini file.

You can add this to the list of ways of launching command terminal.

You might need to bring the command terminal into focus to allow commands to be pasted.
AugustusS
Posts: 3
Joined: 22 Jul 2021, 15:41

Re: Ouvrir un fichier .bat et le laisser affiché à l'écran.

Post by AugustusS »

Hi eureka !

Thank you for your answer, it works like a charm by using Run ! I'll try out the others methods as well, they seem promising.
eureka
Posts: 204
Joined: 08 Mar 2016, 22:18

Re: Ouvrir un fichier .bat et le laisser affiché à l'écran. [Solved]

Post by eureka »

Glad to help.

Actiona is a permanent part of my Ubuntu/Windows/Cloud workflow toolbox but because Actionscript2 (ECMAscript) is rather dated
I look now to integrating Actiona with Python3 scripts to access variables in json.
Good results come from considering Actiona to be part of a toolchain or pipeline rather than expecting all functionality from Actiona.

Actiona offers a nice connector between microservices.
MDLE46
Posts: 108
Joined: 11 Nov 2016, 19:06

Re: Ouvrir un fichier .bat et le laisser affiché à l'écran. [Solved]

Post by MDLE46 »

Bonjour à tous,

voir CMDER , logiciel libre, gratuit et portable à télécharger sur https://www.lesnumeriques.com/telecharger/cmder-33522,

et voir PowerShell à télécharger sur https://www.lesnumeriques.com/telecharg ... hell-20610.

Cordialement, MDLE46.
Post Reply