I was trying to open and close an application. I tried like this:
Dim App1
Set App1 = CreateObject("WScript.Shell")
App1.Run("firefox")
App1.Quit
Firefox will open, but it will not close.
Error message:
object doesn't support this property or method
I referred InDesign Scripting how to quit application (not document)
Please tell me the procedure to close the application.
If you want to be able to terminate a process that way you need to use the Exec
method instead of the Run
method.
Set ff = CreateObject("WScript.Shell").Exec("firefox")
'you do stuff
ff.Terminate
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With