Declare PtrSafe Function OpenProcess Lib "kernel32" (ByVal dwAccess As Long, ByVal lpCommandLine As Long, ByVal IDProcess As Long) As LongPtr
Declare PtrSafe Function GetExitCodeProcess Lib "kernel32" (ByVal lpdExitCode As LongPtr, hHandle As LongPtr) As Long
Declare PtrSafe Function CloseHandle Lib "kernel32" (ByVal hObject As LongPtr) As Long
Public Function saExecCmd(cmdline As String)
Const PROCESS_QUERY_INFORMATION = &H400
Const STILL_ACTIVE = &H103
Dim hProc As LongPtr
Dim lExit As LongPtr
Dim hShell As Long
Dim bret As Long
Dim rtn As Integer
hShell = Shell(cmdline, 1)
hProc = OpenProcess(PROCESS_QUERY_INFORMATION, False, hShell)
Do
GetExitCodeProcess hProc, lExit
DoEvents
Loop While lExit = STILL_ACTIVE
bret = CloseHandle(hProc)
If bret <> 0 Then rtn = 0 Else rtn = 1
saExecCmd = rtn
End Function