2010-02-18 18 views

cevap

2

Bu bir exe dosyası arayıp kabuk komutunu kullanarak buna bir argüman geçmek istiyorum senaryoları göstermektedir.

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 
: Aşağıdaki kod argüman olarak url geçirerek (eğer krom yüklü varsayarak) chrome.exe'ye ikamet ve oradan, www.google.com çağıran klasörü denetler
İlgili konular