Personally, I don't think you can do what you're trying to do automatically. Once I'm done with a table in Pinball FX2, I use the same quit button to exit the table as I use to quit the VP tables. I have Quit in PinballX set to Escape. I then set VP to also use Escape to quite. Works for me. Oh, also, I'm using joystick inputs for PinballFX2 and I had to map out my buttons to find that, for me, Button 7 was the quit button. I also have that mapped in PinballX on the Joystick Input Settings page.
About Batch files - Hint, to put this in very layman's terms, a batch file is just a .txt (text) file that has .bat file extension instead of .txt. You put your command or list of commands inside the .bat file. When you run the .bat (batch) file, it executes the commands in order. Start with creating a new file in Notepad with your commands, then do a save as, but change the type to *.*, give it a filename ending in .bat instead of .txt. You can then run your saved .bat file by double clicking it and edit the file in notepad as needed.
Yes, there are lots of ways to do this. I figured this would be easiest way to explain it to someone who is new to this. If you saved it as .txt first and try to rename it to .bat, you'll prob save it as .bat.txt and that won't work. You'll have to turn on "show file extensions" in Windows Explorer.Here's prob a good link for noobs on batch files if you'd like to dig deeper. http://www.computerhope.com/batch.htm