.bat crash

Closed
Ceryx78 Posts 21 Registration date Friday 13 November 2015 Status Member Last seen 10 April 2016 - 19 Feb 2016 à 20:08
BrianGreen Posts 1005 Registration date Saturday 17 January 2015 Status Contributor Last seen 30 September 2021 - 20 Feb 2016 à 03:57
Bonjour,

Je suis sous Windows 10 et j'ai ce problème :

Dès que je lance un fichier .bat (Batch) la "Console" crash instantanément... En quelques milliseconde, je n'ai donc temps de rien, et je ne peux plus développer de .bat à partir de Visual Basic non plus, merci d'avance de m'aider :)

1 response

BrianGreen Posts 1005 Registration date Saturday 17 January 2015 Status Contributor Last seen 30 September 2021 149
20 Feb 2016 à 03:57
Salut Ceryx78,

Il est probable que votre fichier .bat fonctionne comme il se doit, puis se terminant comme il se doit. Quand il termine son intention de fermer l'invite de commande si vous démarrez le .bat en double cliquant dessus.
Il y a 2 solutions, au pire, mais plus simples ... ajouter ce que la dernière ligne dans votre fichier .bat. Elle permet de conserver la console ouverte jusqu'à ce que vous appuyez sur une touche

pause


Maintenant, la meilleure, mais la version un peu plus complexe:

Ouvrez l'invite de commande en appuyant sur la touche [Windows] et [R] touches ensemble, et tapez
cmd
dans la boîte.
Faites glisser le fichier .bat dans la console
Appuyez sur la touche [Entrée].

Espérons que votre problème est résolu.

S'il vous plaît laissez-moi savoir comment vous allez.


... and now in English ....

Hi Ceryx78,

It is likely that your .bat file is running as it should and then ending as it should. When it ends it will close the command prompt if you start the .bat by double clicking in it.

There are 2 solutions, the worst, but simplest first ... add this as the last line in your .bat file. It will keep the console open until you press a key

pause


Now the better, but slightly more involved version:

Open the command prompt by hitting the [Windows] key and [R] keys together, and type
cmd
into the box.
Drag the .bat file into the console
Press the [Enter] key.

Hopefully your problem is solved.

Please let me know how you get on.