Page 1 of 1

How to launch .bat / WIN 10 directly from Servoy ?

PostPosted: Wed May 15, 2019 12:47 pm
by rainer
I need to execute a .bat file on WIN10 from servoy.

It seems that it fails due do the win10 rights management ( Java Error #740 ).
Tried converting into .exe (admin) or shortcut - but it fails.
Starting the .bat directly from the desktop works.

How can i solve the problem ? Think i need to execute the .bat as admin directly from servoy ?!

Thank you for your help

Rainer

Re: How to launch .bat / WIN 10 from directly from Servoy ?

PostPosted: Wed May 15, 2019 1:29 pm
by Joas
What does your code look like?
It should be something like:
Code: Select all
application.executeProgram("C:/your.bat");

To run a .bat-file with admin rights means that your Servoy process needs to have admin rights, which is probably not a good idea security-wise.

So what are you doing in your .bat file that needs admin rights anyway? Is there no way around that?

Re: How to launch .bat / WIN 10 from directly from Servoy ?

PostPosted: Thu May 16, 2019 11:27 pm
by rainer
Solved.

For .bat files only "plugins.file.openFile" worked...

Re: How to launch .bat / WIN 10 directly from Servoy ?

PostPosted: Mon Jun 03, 2019 9:22 am
by Andrei Costescu
Yes I think application.executeProgram is a bit more low level (and batch files cannot be interpreted directly by that) while plugins.file.openFile is more the equivalent of a "start" command in case of Windows.
So - I didn't try it - but something like this might work (give it something to interpret the .bat file with): application.executeProgram("cmd", ["/c", "your.bat"])