Create a Batch File to Close/Launch/Reopen Programs

Click For Summary
SUMMARY

This discussion focuses on creating a batch file to manage the closing and reopening of programs around a game launch. Users express difficulty in executing programs after the game exits, as standard batch files do not support event-driven execution. Recommendations include using a batch file to close programs and launch the game, but for restarting programs post-game, transitioning to VBScript is advised for better event synchronization capabilities.

PREREQUISITES
  • Basic understanding of batch file scripting
  • Familiarity with command line operations in Windows
  • Knowledge of VBScript for event-driven programming
  • Experience with process management in Windows operating systems
NEXT STEPS
  • Learn advanced batch file scripting techniques
  • Explore VBScript for handling events and process management
  • Investigate Windows Task Scheduler for automated program management
  • Research tools for monitoring application exit events
USEFUL FOR

This discussion is beneficial for Windows users, game developers, and system administrators looking to automate program management around gaming sessions.

jpfuse
Messages
1
Reaction score
0
i don't know if this is even the right forum but i am trying to right a batch file which will close certain running programs, launch a game, and upon exit of the game, run the programs that were closed. i know how to close a prog and open the game, but i don't know how to run the progs when the game exits.
 
Computer science news on Phys.org
i don't know if this is even the right forum but i am trying to right a batch file which will close certain running programs, launch a game, and upon exit of the game, run the programs that were closed. i know how to close a prog and open the game, but i don't know how to run the progs when the game exits.

I'm not real sure if that is doable, unless the game sends some kind of code on exit that could execute a batch file.

What game is it? What programs? Perhaps your best bet would be to simply create a batch file that executes your programs, then use this to start the programs, and a command within this batch starts the game and closes the programs.

As to restarting the programs when the game exits, I'm stumped.
 
I'm with Megashawn. You need some sort of event synchronization that runs when the game is shut down. What you are doing is beyond the scope of a batch file. Batch files are for triggering a series of events, not being triggered by those events. Although they can be made to have some structure, I recommend looking at something like VBScript that was meant for these kind of things.
 

Similar threads

  • · Replies 19 ·
Replies
19
Views
7K
  • · Replies 9 ·
Replies
9
Views
2K
  • · Replies 3 ·
Replies
3
Views
1K
  • · Replies 11 ·
Replies
11
Views
3K
  • · Replies 13 ·
Replies
13
Views
3K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 7 ·
Replies
7
Views
6K
Replies
15
Views
12K
  • · Replies 20 ·
Replies
20
Views
3K
  • · Replies 3 ·
Replies
3
Views
3K