Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Running VFP on Windows server Task Scheduler
Message
From
30/04/2018 08:55:16
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Installation, Setup and Configuration
Miscellaneous
Thread ID:
01659602
Message ID:
01659640
Views:
45
>Hi,
>
>A custom asked me to create a program that would automatically (without any manual input) email a report to a number of people in their organization, on a certain (user-defined) frequency. VFP 9 is the only way I can create such an application. And as far as automatically running it, I am thinking of Windows Task Scheduler. Although, since this program will be running on the company server (I think it is Server 2008 but could be 2012, not sure), I am concerned of "causing" any "inadvertent damage" to the server. Has anybody used this approach of running a VFP application in the Windows Task on a Server? Any potential issues or things that I need to be aware of?
>TIA

You already have some great replies :) Interestingly I am in the process of doing final parts of a change in our "scheduled tasks" runner, I might pass lessons learned. Historically what I am doing is 3rd generation.

1) 1st generation. A VFP application running with a timer and either doing the job given or spawning another VFP application. DON'T DO.
2) 2nd generation. A C# windows service, as the "timer" portion calling VFP application. DON'T DO.
3) 3rd generation. A C# based activex to create a task in the windows scheduler that calls VFP application. This is what I am doing now (and tests past so far).

I am not going into the details of 1 and 2 why not, just accept I would't suggest. The common and most seen problem is "user rights". Another one "VFP timer" quitting silently after some period of time (go figure why). Anyway, it is most important as Michael Cummings noted, log your actions as detailed as possible. It is your best friend to "debug" when something doesn't work as expected.

With windows task scheduler you can create the task either manually, or programmatically using win32TaskScheduler activex or as I do with a wrapper activex (I use this path, just because setting up a task in C# is easier and writing activex myself, I have it under my control what to pass it, what methods it has).

You are saying "email a report". Create reports and email them is also one of the tasks I have. With a few customers probably you wouldn't experience much problems, but with thousands of installations, I experienced interesting problems. For example on some systems, IT admins are very lovely, they even lock down users' temp folders, report to email cannot be generated in the first place (logs reveal that - I have something like IsFolderReadWrite() checks). Sending emails in counts cause problems with servers, sometimes you need to provide more than a second pause between emails. How you send the email might be another problem. I have been using a well known 3rd party tool to do that and regretted many times that I didn't write mine with C# many times (and still bearing with it just because I can't allocate time). It is an activex object, and I needed to create its object per email I sent ! (simply creating the object once and then sending multiple emails, it was failing and we could only trace it on the email server using low level processes).

These are that come to mind for now. Good luck.
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform