PROCEDURE RunShellScript LPARAMETERS tcCommand, tlSilentMode, tcRetVal IF EMPTY(m.tcCommand) RETURN ENDIF LOCAL oShell, llError, loException, lnErrorCode llError = .F. TRY oShell = CREATEOBJECT("WScript.Shell") CATCH TO loException IF m.tlSilentMode tcRetVal = "Run-time error: WScript.Shell Object is not Found" ELSE =MESSAGEBOX("Run-time error: WScript.Shell Object is not Found") ENDIF llError = .T. ENDTRY IF m.llError <> .T. TRY lnErrorCode = oShell.RUN(m.tcCommand, 0,.T.) && SW_SHOW_HIDDEN 0,SW_SHOW_NORMAL 1,SW_SHOW_MINIMIZED 2,SW_SHOW_MAXIMIZED 3 IF m.lnErrorCode <> 0 tcRetVal = "Error in running shell command. Error Code: " + TRANSFORM(m.lnErrorCode) ENDIF CATCH TO loException IF m.tlSilentMode tcRetVal = "Run-time error: WScript.Shell: " + ; m.tcCommand + CHR(13) + CHR(10) + Log_Error(m.loException) ELSE =MESSAGEBOX("Run-time error: WScript.Shell: " + m.tcCommand) ENDIF llError = .T. ENDTRY ENDIF RELEASE oShell RETURN !m.llErrorSupply your command as a string with fullpath for your .exe and a text file. (use fullpath function to get a path, or curdir())