Close an application using VBScript

后端 未结 5 1641
南旧
南旧 2020-12-10 08:10

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
         


        
5条回答
  •  醉酒成梦
    2020-12-10 08:53

    Good work for this example:

    Dim oShell : Set oShell = CreateObject("WScript.Shell")
    oShell.Run """C:\My_Scripts\ddl.exe"" -p1 -c"
    
    'some code
    
    oShell.Run "taskkill /f /im ddl.exe", , True
    

提交回复
热议问题