Use the following syntax to execute the batch file.
Runtime.getRuntime().exec("cmd /c start file.bat");
I tried your suggestion – however it does not work as I expected. The process seems to execute – however nothing of what is in the bat file is done:
E.g. I have this bat file – and when I run it with your suggestion in LC nothing happens – when I run it on the server I get the copy of the file:
I have added the following in my Execute Script service action:
Runtime.getRuntime().exec("cmd /c c:\\file.bat");
The .bat file looks like this:
When I run the cmd /c c:\\echoName.bat in the "Run" window on the server it executes as expected, but not when I invoke the Process through Workbench.
What am I doing wrong – do I need to setup something on my server (Systems is: JBoss Turnkey, MySQL, LC 2.5)?
Your batch file should be placed in server or in a shared folder where the
server has access.
The .bat file is located here: c:\file.bat
on the server. When I invoke the process through Workbench nothing happens, but when I execute "cmd /c c:\file.bat" in "Run" on the server then the .bat file is executed.