I would consider using powershell instead of bat for such jenkins tasks, 
then Start-Job 
<https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/start-job?view=powershell-7.1>
 should 
do the trick ( you will need to also call Stop-Job once you are done of 
course).

christop...@googlemail.com schrieb am Dienstag, 31. August 2021 um 10:42:03 
UTC+2:

> In my opinion "call" is not the right statement to call an exe. Can you 
> try it with a start with the proper arguments?
> Regards,
> Christoph
>
> slide schrieb am Donnerstag, 19. August 2021 um 17:28:44 UTC+2:
>
>> Does the application try and interact with the desktop? If you are 
>> running the agent/jenkins as a Windows service, it will not be able to 
>> interact with the desktop by default. You need to search for "services 
>> interact desktop windows" to find information on how to enable it.
>>
>> On Thu, Aug 19, 2021 at 8:20 AM Mahmoud Beltagy <mahmoud...@ejad.com.eg> 
>> wrote:
>>
>>> It is important for my build to open this exe, without it the build 
>>> process will fail, so the issue is not continuing the process.
>>> I want jenkins to be able to open an external exe to use it in the build 
>>> process
>>>
>>> On Wednesday, August 18, 2021 at 4:01:27 PM UTC+2 ice...@googlemail.com 
>>> wrote:
>>>
>>>> mahmoud...@ejad.com.eg schrieb am Mittwoch, 18. August 2021 um 
>>>> 15:14:13 UTC+2:
>>>>
>>>>> I have the same issue here.
>>>>> I have a .bat file named bat *RunUSBRedirector.bat* that only has one 
>>>>> line
>>>>>
>>>>> *call "C:\Program Files\USB Redirector Client\usbredirectorlt.exe"*
>>>>> this line should start the application USB Redirector Client
>>>>> when I invoke this .bat file in the cmd it behaves as expected, but 
>>>>> when I try to run it in jenkins [bat """RunUSBRedirector.bat"""]  it gets 
>>>>> stuck.
>>>>> I tried the mentioned points:
>>>>> -Run another exe (calc.exe for example) it worked, but when I tried 
>>>>> another exe that I installed a few months ago it did not work
>>>>> -using cmd /c does not change anything
>>>>> -I get an error when I add a typo to the name of the exe
>>>>> -I don't think the program waits for stdin, and I don't know how to 
>>>>> close it (NOTE: cmd window does not show)
>>>>>
>>>>
>>>> Yes,  that is expected. You can only usefully commands that finish at 
>>>> some point in time and only then the next command will be executed. 
>>>> If the program runs forever then it looks like it is stuck (but it is 
>>>> just  waiting for the program to finish).  
>>>> See https://superuser.com/a/341603 for how send a program into 
>>>> background on windows.  
>>>> You should also have some way to stop the program again before your  
>>>> jenkins job exits....
>>>>  
>>>>
>>>>> -the web interface does not get stuck
>>>>>
>>>> -- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "Jenkins Users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to jenkinsci-use...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/jenkinsci-users/9962af5c-e61e-455a-bb9b-96f7cfb2ab21n%40googlegroups.com
>>>  
>>> <https://groups.google.com/d/msgid/jenkinsci-users/9962af5c-e61e-455a-bb9b-96f7cfb2ab21n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>>
>>
>> -- 
>> Website: http://earl-of-code.com
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/2c18fd43-f6fd-4847-a936-cf2c4d8d5c32n%40googlegroups.com.

Reply via email to