Execute external program and redirect output to file


/ Published in: W-Language
Save to your folder(s)



Copy this code and paste it in your HTML
  1. TempFile is string = "executethis.bat"
  2. FID = fCreate(TempFile)
  3. IF FID = -1 THEN sErr = "Could not create a bat file."
  4. scommand is string = fexedir()+"\someprog.exe -param1 > someprog.out"
  5. IF NOT fWriteLine(FID, scommand) THEN sErr = "Could not write in bat file."
  6. fClose(FID)
  7. IF NOT ExeRun(TempFile ,exeIconize,exeWait) THEN sErr = "Could not executed the bat file."
  8. fDelete(TempFile)

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.