2010-02-18 2 views

답변

2

이것은 당신이 exe 파일을 호출하고 쉘 명령을 사용하여에 인수를 전달하려는 시나리오를 보여줍니다.

Public Sub Display_Google() 
    Dim chromePath As String 
    chromePath = "C:\Program Files\Google\Chrome\Application\chrome.exe" 

    If FileExists(chromePath) Then 
    Shell (chromePath & " -url" & " " & "www.google.com"), vbMaximizedFocus 
    Else 

    chromePath = "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" 
    Shell (chromePath & " -url" & " " & "www.google.com"), vbMaximizedFocus 
    End If 
End Sub 

Public Function FileExists(ByVal FileName As String) As Boolean 
    On Error Resume Next 
    FileExists = Not CBool(GetAttr(FileName) And (vbDirectory Or vbVolume)) 
    On Error GoTo 0 
End Function 
: 다음 코드는 인수로 URL을 전달하여 (당신은 크롬을 설치 한 가정) chrome.exe의이 거주하고에서가, www.google.com를 호출 폴더를 검사합니다
관련 문제