开云体育

Locked Re: Execute a Windows Batch File from LogixNG or Script #logixng


 

Try this bit of jython

Import java
command = “foo.bat”
argument = “something or blank"
java.lang.Runtime.getRuntime().exec([command, argument])

Bob


On Sep 28, 2024, at 1:50?PM, Vinny DeRobertis via groups.io <vinny.derobertis@...> wrote:

Team,
How can I execute a .bat file from either LogixNG or Jython script?
--

Many thanks in advance!

Vinny DeRobertis ~ Apex, NC
New York & Hudson Valley RR

Windows 7 Pro / Java 11 / JMRI v5.7.7
Command Station: Digikeijs DR5000.
Booster: Digikeijs DR5033
Interface: Samsung A7 10.4" Tablets/Fully Kiosk.
DCC/DMX Gateway: Pricom LLS.
LocoNet Input Modules: Digikeijs DR4088LN
DCC Output Modules:
Digikeijs DR4018 / Yamorc YD8116.
Sensors: Model Train Technology: DETECTOR-HO.
Turnout Motors: MTB MP1

Bob Jacobsen
rgj1927@...

Join [email protected] to automatically receive all group messages.