Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PRG file automation

Status
Not open for further replies.

joshuaguilty

Programmer
Apr 26, 2005
81
CA
I have a script file (PRG) which I would like to run on the server at night time.
Could anyone show me how to do it?
Thank you.
 
The easiest way would be to call Fox from the Windows Task Scheduler and pass the program name as a parameter:

[TT]
"C:\Program Files\Microsoft Visual FoxPro 9\vfp9.exe" "c:\MyFolder\MyProgram.prg"
[/TT]

If you add the QUIT command to the end of your program then Fox will close when it finishes.

This assumes that you've got Fox installed on the server. If not, you'll have to build the program into an executable. If you're not sure how to do this just ask and somebody will talk you through it.

Geoff Franklin
 
I have created a batch file top run a PRG under Fox Pro.
Everything seems to be fine besides I got a message
"KEY already exists, overwrite it?
My question how I could put a "Y"es automatically in my batch file?
Thanks.
 
If the message is resulting from a command in the .prg file ( which it appears to be), then you can put the command SET SAFETY OFF on the line before the command that results in the message. Then issue the SET SAFETY ON command immediately after it.

More elegant programming calls for checking the SET status of SAFETY before changing it, but if you're getting that message from the .prg, it is clearly ON.

Otherwise, if the message is coming from the operating system itself, you might be better off to post the thread in the appropriate OS forum .

hth,
dennis
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top