function, otherwise Shell endup in a default my documents directory
and there is no way to tell it the right path.
This function calls CMD with the path parameter and the file
parameter. Path parameter also guarantees that your executable will
find any files it needs.
Public Function runSchell(Optional path As String = "", Optional file
As String = "XCheckSample.exe") As Long
    Dim st As String
    If path = "" Then path = CurrentProject.path & "/temp"
    st = "cmd /c Start ""Title"" /wait /D """ & path & """ " & file
    runSchell = Shell(st, 1)
End Function
 
Geen opmerkingen:
Een reactie posten