Jump to content


Photo
- - - - -

ASYNC option for SYSTEM command


3 replies to this topic

#1 Lewis Mccabe

Lewis Mccabe

    ProIV Guru

  • Members
  • PipPipPipPipPip
  • 455 posts
  • Gender:Male
  • Location:Sarasota, Florida

Posted 18 November 2006 - 04:45 AM

Has anyone been successful in getting the ASYNC option for the SYSTEM command to work? We want the program to execute on the server under Windows. Docs say this should work but it doesn't: #STAT = SYSTEM('ASYNC some_program.exe')

We are on version 5.5. Thanks.

Lew

#2 Mike Schoen

Mike Schoen

    Expert

  • Members
  • PipPipPipPip
  • 198 posts
  • Gender:Male
  • Location:Guelph, Canada

Posted 18 November 2006 - 12:12 PM

You can use the "start" command:

I did this as a test:

DIR.bat contents:
dir c:\ /s > c:\temp\dir.txt

Pro-iv logic:
001 #I = SYSTEM('START C:\TEMP\DIR.BAT')
002 UMSG('RETURNED, STATUS IS ' + CONV(#I),-1)
This immediatly returns with a status code of 0, and the batch file keeps running in the background until it completes.

Just remember that this is being as a child process of the pro-iv server, so you can't run anything that requires any sort of user input.

(Actually you can, but then you need to go kill the hung process when it fails -- dont ask ;) )

#3 Lewis Mccabe

Lewis Mccabe

    ProIV Guru

  • Members
  • PipPipPipPipPip
  • 455 posts
  • Gender:Male
  • Location:Sarasota, Florida

Posted 18 November 2006 - 06:29 PM

Thanks Mike. I will give it a go.

#4 Lewis Mccabe

Lewis Mccabe

    ProIV Guru

  • Members
  • PipPipPipPipPip
  • 455 posts
  • Gender:Male
  • Location:Sarasota, Florida

Posted 20 November 2006 - 03:18 PM

Mike,

Works fine. Thanks.



Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users