System.util.execute bat that closes and restarts vision client

I'm trying to execute a batch file that closes the Vision client that executes it and restarts it. What I'm finding though, is that after the client stops, the rest of the batch script just stops running as well and the client never restarts. I'm assuming that the batch file process is actually running under Vision, so once it closes, it dies itself as well.

How can i work around this?

You can try executing it is a scheduled task. That might provide enough separation between the OS and the JVM.

Does Windows still have a start executable?

Yep. Just thought of that one, too.

I'll give this a go - I tried calling another batch from the first batch, but I didn't use start

Wouldn't a system.util.retarget() to the same project do what you want?


Unfortunately no. For some context: we have two PCs out on a line that display 2x Vision clients each on 4x TV screens. These have startup scripts to display the right screens based on a couple of Vision client tags supplied by the Vision client launcher configuration.
These PCs also launch a whole bunch of useless software on these PCs like Teams, but I can't change the startup apps and IT is far more effort than they're worth to get them to fix it (it would likely take years), so I use a batch file to kill the processes instead, and then launch the two Vision client shortcuts.

We've had reports that sometimes the TV screens misbehave, and the windows don't show up as fullscreen. The PCs themselves are only accessible through a gate attached to a safety lockout which operators don't have access through. In the meantime while I try to get time to work out what's going awry, I wanted to give them the ability from the main HMI to execute the batch file themselves to kill the processes (which includes java.exe) and restart Vision.

I did get this working in the end using start "" "C:\...\name.batch". I was trying call but this waits for the script to end and return :confused: and calls it as a subprocess I assume
Thanks @pturmel !

Could you just use the client startup script to check for other running instances and kill them?
Then you would just have to launch a new instance?

If going with the bat file I would install Dameware or VNC on those machines to be able to remote and manipulate if needed.

1 Like