rvdvalk
13th February 2008, 13:56
Hello,
I am trying to configure jobs in our system and run into some problems when it comes to scheduleling these jobs.
The Dutch company that is supporting us offsite uses a script schedule jobs using Windows scheduler.
We create a cmd-file with the following.
start "C:\Program Files\Baan\Baan Windows\bin\bw.exe" "C:\Program Files\Baan\Baan Windows\lib\user\job124.bwc" -- -set BSH_JOB=TESTJOB ttaad5203m000
The idea is that when the Windows scheduler starts it starts the LN menu and starts the session in bold.
This session should start the TESTJOB
The reason to do it this way, they said, is that you do not need to be logged on all the time.
The problem is that the session won't start, eventhough the menu does start.
Is there anyone who can help me out or has another idea about scheduling jobs?
Han Brinkman
13th February 2008, 14:15
I use this file (slightly different) for BaanVc, called startjob200.bat:
@echo off
set BSE_NAME=Baan
set BSE=f:\baan
set BSE_TMP=%BSE%\tmp
set PATH=%PATH%;f:\baan\bin
if "%1" == "" goto argerror
start f:\baan\bin\bw.exe f:\baan\lib\user\job200.bwc -- -set BSH_JOB=%1 -set BSH
_JOBOK="%2" -set BSH_FRSES="%3" ttaad5203m000
goto end
:argerror
echo Usage: startjob name-of-job-to-start [jobfile-OK] [From-session-number]
goto end
:end
What's the status of your job?
Regards,
Han
rvdvalk
13th February 2008, 14:29
Hello Han,
All jobs are free
I am going to try your script.
Keep you posted.
This is what I have now.
@echo off
set BSE_NAME=Baan
set BSE=f:\erpln
set BSE_TMP=%BSE%\tmp
set PATH=%PATH%;f:\erpln\bin
if "%1" == "" goto argerror
start C:\Program Files\Baan\Baan Windows\bin\bw.exe C:\Program Files\Baan\Baan Windows\lib\user\job124.bwc -- -set
BSH_JOB=%1 -set BSH_JOBOK="%2" -set BSH_FRSES="%3" ttaad5203m000
goto end
:argerror
echo Usage: startjob TESTJOB [jobfile-OK] [From-session-number]
goto end
:end
It just doesn't seem to do anything, no errors nothing.
Can you explain me the things that are being set?
Han Brinkman
14th February 2008, 12:28
You can easily test this.
Create a job which e.g. prints the areas.
Run the script with argument JOBNAME.
Pre-requisites:
- you need to be logged on the server as the user that runs the job;
- the bwc file should contain the password of the user. You have to store it while being logged on as the user that is going to run the job!!!
- Status of job must be free and flags Run Periodical and External Scheduler turned on.
Regards,
Han
mmurphy2650
18th February 2008, 15:03
Hi,
We use ntbshell.exe with the -server option to start jobs.
The one problem that we have run into is that any sessions in the job that have printed output must be directed to a Windows Server Printer. If printed output is directed to a Windows Printer, the job status shows as running, but never finishes.
Hope this helps ....
Startjob.bat:
@echo on
@setlocal
@if "%1" == "" goto argerror
@if "%BSE%" == "" goto argbseerror
@if NOT "%1" == "" set BSH_JOB=%1
@if NOT "%2" == "" set BSH_JOBOK="%2"
@if NOT "%3" == "" set BSH_FRSES="%3"
%BSE%\bin\ntbshell.exe -server ttaad5203m000
@goto end
:argerror
@echo Usage: startjob name-of-job-to-start [jobfile-OK] [From-session-number]
@goto error
:argbseerror
@echo Error: environment variable BSE not set. Set BSE variable before executing this script.
@goto error
:error
@REM generate error on OS level
@dir /fake > nul 2>&1
@goto end
:end
@endlocal