[Solved] How to kill proces
Posted: Sun May 05, 2019 5:50 pm
Hi, I'd like to use a macro to stop running an acrobat reader before creating a pdf.
I'm trying something like that :
oSys = CreateUnoService("com.sun.star.system.SystemShellExecute")
oSys.execute("C:\Program Files (x86)\Adobe\Acrobat Reader DC\Reader\AcroRd32.exe","",0)
oSys.execute("C:\Program Files (x86)\Adobe\Acrobat Reader DC\Reader\AcroRd32.exe", "kill",1)
or like this
shell("pkill C:\Program Files (x86)\Adobe\Acrobat Reader DC\Reader\AcroRd32.exe")
Or close the open file directly
address = ConvertToUrl(sPATH)
shell("pkill" & address)
The problem is that I want to overwrite the open PDF file, so I must close it first, otherwise the program ends with an error.
I don't know Shell at all, I'm just trying.
Can anyone help? Thanks
I'm trying something like that :
oSys = CreateUnoService("com.sun.star.system.SystemShellExecute")
oSys.execute("C:\Program Files (x86)\Adobe\Acrobat Reader DC\Reader\AcroRd32.exe","",0)
oSys.execute("C:\Program Files (x86)\Adobe\Acrobat Reader DC\Reader\AcroRd32.exe", "kill",1)
or like this
shell("pkill C:\Program Files (x86)\Adobe\Acrobat Reader DC\Reader\AcroRd32.exe")
Or close the open file directly
address = ConvertToUrl(sPATH)
shell("pkill" & address)
The problem is that I want to overwrite the open PDF file, so I must close it first, otherwise the program ends with an error.
I don't know Shell at all, I'm just trying.
Can anyone help? Thanks