1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| Dim Result, CommandString, fName, fCommandString
fName = "D:\Files Exeample\GPIT-F_Calibration_Report.txt" ''"C:\WINDOWS\system32\cmd.exe" ''"Index.html"
fCommandString = "pdsdecode -p ""D:\Files Exeample\GPIT-F_Calibration_Report.PDS"" -d ""D:\Files Exeample\GPIT-F_Calibration_Report.txt"""
''MsgBox (fCommandString)
''Result = ShellExecute(hwnd, "Open", fName, fCommandString, 0, 0)
''Result = ShellExecute(hwnd, 0, fName, fCommandString, 0, 0)
''ShellExecute 0, vbNullString, "D:\Files Exeample\GPIT-F_Calibration_Report.txt", vbNullString, vbNullString, 0
Dim ExecuteEncodeInfo As SHELLEXECUTEINFO
With ExecuteEncodeInfo
ExecuteEncodeInfo.cbSize = Len(ExecuteEncodeInfo) 'sizeof(ExecuteEncodeInfo)
ExecuteEncodeInfo.fMask = 0
ExecuteEncodeInfo.hwnd = 0
ExecuteEncodeInfo.lpVerb = "Open"
ExecuteEncodeInfo.lpFile = "C:\WINDOWS\system32\cmd.exe"
ExecuteEncodeInfo.lpParameters = fCommandString
ExecuteEncodeInfo.lpDirectory = 0
ExecuteEncodeInfo.nShow = 1
ExecuteEncodeInfo.hInstApp = 0
End With
If Result = ShellExecuteEX(ExecuteEncodeInfo) = False Then MsgBox ("Error while executing command") _
Else Call WaitForSingleObject(ExecuteEncodeInfo.hProcess, WAIT_INFINITE) |
Partager