Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Batch File to start application restarts itself again and again

Tags:

batch-file

cmd

I'm trying to create a batch script to activate a conda environment and start an application within it (which has been previously installed). But for whatever reason, the application doesn't start but the batch script itself restarts again and again.

I'm using the following script:

@ECHO OFF

ECHO Activate Environment ...
call activate ENV

ECHO Start application ...
ApplicationName

PAUSE

The output if I start the batch script by doubleclicking it is:

Activate Environment ...    
Start application ...
Activate Environment ...    
Start application ...
Activate Environment ...    
Start application ...

I also tried with call ApplicationName and start ApplicationName but this doesn't work either. The application I would like to start is an own application which can be installed via pip (Python application, entrypoint specified in setup.py).

The normal use is to open a cmd or the Anaconda prompt, activate the environment manually and enter the command ApplicationName on the command line. After this the application triggers a browser window to open a login screen. When I use the application like that the command line window stays open during the execution of my application and prints debug messages.

I just don't understand why the commands are repeated again and again instead of that the application is started. Do you know what causes the behaviour?

Thank you in advance for an answer! Best Regards

like image 290
user2550641 Avatar asked Dec 07 '25 07:12

user2550641


1 Answers

Your batch file has the same name as your undisclosed ApplicationName.
Therefore the batch file will restart ApplicationName.bat instead of ApplicationName.exe

like image 102
jeb Avatar answered Dec 09 '25 17:12

jeb



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!