F5F Stay Refreshed Software General Software Assistance with creating Windows batch files to launch programs and restart the original after the second one exits.

Assistance with creating Windows batch files to launch programs and restart the original after the second one exits.

Assistance with creating Windows batch files to launch programs and restart the original after the second one exits.

E
Emmy149
Member
56
05-06-2016, 03:15 PM
#1
Hi guys, I need some assistance. I'm not very experienced with programmers or batch creators, so I thought I'd ask for advice here...

I want to set up something like this (assuming I'm already in Program A where I can run a custom script to call a .bat file from). When the .bat system starts:
1- close Program A
2 - start Program B
3 - when Program B closes, start Program A again
I'm not sure if this is feasible, but any suggestions would be great!

Windows 10 Pro
E
Emmy149
05-06-2016, 03:15 PM #1

Hi guys, I need some assistance. I'm not very experienced with programmers or batch creators, so I thought I'd ask for advice here...

I want to set up something like this (assuming I'm already in Program A where I can run a custom script to call a .bat file from). When the .bat system starts:
1- close Program A
2 - start Program B
3 - when Program B closes, start Program A again
I'm not sure if this is feasible, but any suggestions would be great!

Windows 10 Pro

G
GalaxOG
Junior Member
10
05-07-2016, 11:49 PM
#2
Create two batfiles. Swap program_a.exe and program_b.exe as needed.
batfile1.bat
Code:
@echo running batfile1
cd c:\program_a
./program_a.exe
pause
call batfile2.bat

batfile2.bat
Code:
@echo running batfile2
cd c:\program_b
./program_b.exe
pause
call batfile1.bat
G
GalaxOG
05-07-2016, 11:49 PM #2

Create two batfiles. Swap program_a.exe and program_b.exe as needed.
batfile1.bat
Code:
@echo running batfile1
cd c:\program_a
./program_a.exe
pause
call batfile2.bat

batfile2.bat
Code:
@echo running batfile2
cd c:\program_b
./program_b.exe
pause
call batfile1.bat

N
NicolasManny
Member
74
05-08-2016, 08:11 AM
#3
It appears to be very straightforward. What methods have you attempted and which ones fail? Also, note that you might encounter an infinite loop.
N
NicolasManny
05-08-2016, 08:11 AM #3

It appears to be very straightforward. What methods have you attempted and which ones fail? Also, note that you might encounter an infinite loop.

M
milozzy1
Junior Member
41
05-15-2016, 04:02 AM
#4
Seconding
@SkyNetRising
Program A refers to a specific initiative, while Program B outlines another approach. Program B is closed due to certain constraints, and the reasons behind its closure are important. A PowerShell script could provide clearer insights into these details.
M
milozzy1
05-15-2016, 04:02 AM #4

Seconding
@SkyNetRising
Program A refers to a specific initiative, while Program B outlines another approach. Program B is closed due to certain constraints, and the reasons behind its closure are important. A PowerShell script could provide clearer insights into these details.

D
David_Martial
Member
231
05-17-2016, 11:14 AM
#5
Program A serves as a frontend for the virtual pinball cabinet named pinuppopper. Program B acts as a frontend for retro gaming called BigBox. In short, the cabinet supports both pinball and retro games, though each frontend excels at its own platform but struggles with the other. I received advice from the pinball team to develop a batch file that launches pinuppopper and then starts BigBox. The batch file is functional, using naming properties so it appears in the operator menu within the frontend, enabling smooth transitions between A and B. This process moves me from B back to A without creating an endless loop, as the batch runs manually. Please let me know if you need further assistance!
D
David_Martial
05-17-2016, 11:14 AM #5

Program A serves as a frontend for the virtual pinball cabinet named pinuppopper. Program B acts as a frontend for retro gaming called BigBox. In short, the cabinet supports both pinball and retro games, though each frontend excels at its own platform but struggles with the other. I received advice from the pinball team to develop a batch file that launches pinuppopper and then starts BigBox. The batch file is functional, using naming properties so it appears in the operator menu within the frontend, enabling smooth transitions between A and B. This process moves me from B back to A without creating an endless loop, as the batch runs manually. Please let me know if you need further assistance!

O
opticgunship
Posting Freak
815
05-17-2016, 05:46 PM
#6
Create two batfiles. Swap program_a.exe and program_b.exe as needed.
batfile1.bat
Code:
@echo running program_a.exe
cd c:\program_a
pause
call batfile2.bat

batfile2.bat
Code:
@echo running program_b.exe
cd c:\program_b
pause
call batfile1.bat
O
opticgunship
05-17-2016, 05:46 PM #6

Create two batfiles. Swap program_a.exe and program_b.exe as needed.
batfile1.bat
Code:
@echo running program_a.exe
cd c:\program_a
pause
call batfile2.bat

batfile2.bat
Code:
@echo running program_b.exe
cd c:\program_b
pause
call batfile1.bat

P
PlzShutUp
Junior Member
21
05-18-2016, 04:25 AM
#7
This would likely be a more suitable option for these tasks.
P
PlzShutUp
05-18-2016, 04:25 AM #7

This would likely be a more suitable option for these tasks.

V
ViralControl
Member
187
05-20-2016, 01:44 AM
#8
Avoid calling the other batfile recursively, or you'll be getting trouble.
V
ViralControl
05-20-2016, 01:44 AM #8

Avoid calling the other batfile recursively, or you'll be getting trouble.