Page 1 of 1

Running a .bat script in silent mode

Posted: Thu Mar 11, 2021 3:15 am
by gkick
Hi,

Shell does not recognise a batchfile unless its compiled bat2exe or embedded within a cmd command.
I got the following working, but it throws up the console window.

Code: Select all

Sub modp
Dim objExec As Object
objExec = createUnoService("com.sun.star.system.SystemShellExecute")
objExec.execute("C:Windows\system32\cmd.exe", "/d /c ""C:\LDS\sMplan\lib\setm.bat""", 0)
End Sub
Any one knows how to possible run this in a silent way, thks

Re: Running a .bat script in silent mode

Posted: Thu Mar 11, 2021 8:01 am
by Zizi64
Is the ECHO option switched ON in the batch file?

Re: Running a .bat script in silent mode

Posted: Thu Mar 11, 2021 8:22 am
by gkick
Hi Zizi64, no echo is off

Re: Running a .bat script in silent mode

Posted: Thu Mar 11, 2021 9:02 am
by robleyd
Have a look at https://stackoverflow.com/questions/235 ... ne-visible - maybe something there will help.

Re: Running a .bat script in silent mode

Posted: Thu Mar 11, 2021 9:30 am
by gkick
@robleyd Thanks for the link, trouble is LO does not like running vbs scripts either from shell. Tell me where is Murbko ?

Re: Running a .bat script in silent mode

Posted: Thu Mar 11, 2021 11:44 am
by robleyd
I was wondering if the start would be helpful, or using a link to invoke the batch file.
gkick wrote:Tell me where is Murbko ?
In the middle of nowhere :D