2015-10-20 38 views

回答

1

试试这个示例:

Option Explicit 
Dim Application 
Application = "D:\Offroad Madness.swf" 'Path to your swf file.Just change this line 
Call RunThis(Application) 
'********************************************************************************* 
Sub RunThis(Application) 
    Dim Title,Ws,Question,Result 
    Title = "Open SWF Files by Hackoo 2015" 
    Set Ws = CreateObject("WScript.Shell") 
    Question = MsgBox("Did you want to open this file "& DblQuote(Application) &" with iexplore ?" & Vbcr &_ 
    "Yes ==> To open the swf file with iexplore" & Vbcr &_ 
    "No ==> To open the swf file with default program" & Vbcr &_ 
    "Cancel ==> To quit this script",vbQuestion+vbYesNoCancel,Title) 
    If Question = vbYes Then 
     Result = Ws.Run("iexplore.exe "& DblQuote(Application),1,False) 
    End If 
    If Question = vbNo Then 
     Result = Ws.Run(DblQuote(Application),1,False) 
    End If 
    If Question = vbCancel Then 
     Wscript.Quit() 
    End If 
End Sub 
'********************************************************************************* 
Function DblQuote(Str) 
    DblQuote = Chr(34) & Str & Chr(34) 
End Function 
'********************************************************************************* 
相关问题