Philip Sommers Posted March 13, 2002 Posted March 13, 2002 I am trying to use a batch file to open a file called "ScriptScheduler.fp5". The batch file works perfectly when run from the DOS command line, but won't run from the Task Scheduler. I've tried moving the batch file ("Script.bat") into the WINNT directory, but it didn't make any difference. Does the batch file need to reside in the same directory as the .FMP file that I want to open?: The batch file (Script.bat): start "c:program filesfilemakerfilemaker pro 5filemaker pro.exe" "c:winntprofilessommelpdesktopScriptScheduler.fp5" What am I doing wrong here?
DykstrL Posted March 16, 2002 Posted March 16, 2002 Try this in your batch file: set FMSDir=c:FileMakerServer set FMPDir=c:Program FilesFileMakerFileMaker Pro 5 set FMP="%FMPDir%FileMaker Pro.exe" %FMP% "%FMSDir%schedulerScriptScheduler.FP5" I put by BATch files in a folder off the root [c:]
Philip Sommers Posted March 18, 2002 Author Posted March 18, 2002 Thanks for your response, dykstrl. I tried substituting your code for mine (with the paths changed to reflect my file locations), but I still couldn't get it to work. Runs like a champ when called from DOS, but Task Scheduler still won't call Script.bat. This is how I currently have it set up: FMS Directory: C:Program FilesFilemakerFilemaker Server 5 FMP Directory: C:Program FilesFilemakerFilemaker Pro 5 ScriptScheduler.fp5 location: C:Program FilesFilemakerFilemaker Server 5Scheduler Batch File Location: C:BatchScript.bat C:Program FilesFilemakerFilemaker Server 5 Script.bat: Set FMSDir=c:Program FilesFilemakerFilemaker Server 5 Set FMPDir=c:Program FilesFilemakerFilemaker Pro 5 Set FMP="%FMPDir%Filemaker Pro.exe" %FMP% "%FMSDir%SchedulerScriptScheduler.FP5" See any reason why Task Scheduler isn't calling the batch file? [ March 18, 2002, 12:29 PM: Message edited by: Philip Sommers ]
Will Posted March 19, 2002 Posted March 19, 2002 What O/S is this? You are using either the System account or an account with Administrator privliges to run the task, correct? Will
DykstrL Posted March 20, 2002 Posted March 20, 2002 2 things come to mind: Check the event viewer to see if there are any error messages related to the Task Scheduler if it ran or not. Second - try moving the file to a higher level (such as c:backup) - I have seen times that the file path is too long.
Philip Sommers Posted March 21, 2002 Author Posted March 21, 2002 Will: I'm running NT 4.0 with admin privileges, but I'm running FMP 5.0 and Server 5.0 on the same machine for testing purposes (yeah, I know I'm not supposed to do that, but for the time being, I have no choice). dykstrl: When you say move the file to a higher level, I assume you are talking about the batch file (script.bat). I have tried it both in the root of C (C:script.bat) and in a subdirectory of C. I've also tried moving around the location of the ScriptScheduler.fp5 file. When you say "event viewer", are you referring to the "Task" column in the console Task Scheduler? If not, how do I access the event viewer that you're talking about?
DykstrL Posted March 21, 2002 Posted March 21, 2002 It should be located in Administrative Tools in the Start menu.
Will Posted March 22, 2002 Posted March 22, 2002 Maybe a shot in the dark but have you tried running the batch file using the "AT" command instead of the task scheduler? Will
Matt Klein Posted April 30, 2002 Posted April 30, 2002 Phillip - did you ever figure this out? I am having the same sort of problem. I have nearly identical batch files in the same location. One for stopping and then one for starting the service. They both work like a champ from the command line. I set up two schedule with FileMaker Server 5.5 scheduler. Each one identical except for time of day and batch file to run. The scheduler runs the Stop batch file no problem, but it will not run the Start batch file.
Philip Sommers Posted May 1, 2002 Author Posted May 1, 2002 Lwlgeorge: I still haven't figured it out yet (I've been working on other aspects of the project and haven't revisited the batch problem since the last posts. I was only trying to open and close the file (the scripts run upon opening the file). I haven't tried to start/stop service yet. If I figure it out, I'll shoot you an e-mail and post it here. Regards ...
Matt Klein Posted May 1, 2002 Posted May 1, 2002 I appreciate that. Thanks! If I come up with anything, I will do the same.
Will Posted May 10, 2002 Posted May 10, 2002 Phillip: Here's what works for me under NT4. Assuming a batch file named filemaker.cmd on c: that I want to run every Friday at 10 AM (Note: unless you have a reason not to I would rename .bat files to .cmd under NT/2000) at the command line type the following: at 10:00 /interactive /every:f "c:filemaker.cmd" I believe there may be some issues with scheduling a batch to run under task scheduler/at if you tell it to run within 24 hours so try setting the date back a few days to test then just forward to that day or schedule the batch to run a couple of days later. Make sure to put the path in quotes. Let me know if this works. Will
Recommended Posts
This topic is 8569 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now