Baanboard.com

Baanboard.com (http://www.baanboard.com/baanboard/index.php)
-   Tools Administration & Installation (http://www.baanboard.com/baanboard/forumdisplay.php?f=2)
-   -   Scheduling Jobs with windows (http://www.baanboard.com/baanboard/showthread.php?t=66938)

lebowski 30th September 2014 16:53

Scheduling Jobs with windows
 
Hello,

I am moving from unix to windows and want to schedule the jobs using the task scheduler and the script startjob.bat.

Problem: The job name has a blank in it, e.g. TEST JOB.
In Unix I could start the job using double quotes :$BSE/etc/rc.startjob "TEST JOB"

If I do the same in Windows, the job is not started. I also tried 'TEST JOB' or `TEST JOB`.

If I rename the job to TEST_JOB (no blank) it works, but there are quiete a few jobs with blanks and I am lazy :-)

Can you help me with the syntax ?

lebowski

bhushanchanda 30th September 2014 18:21

Hi,

What I did was, create a bat file to run the Jobs. And added the bat files to the Scheduler.

It works with/without spaces:-

Sample:-

Code:

set BSE=D:\Infor\FP7LN\bse\
set USER=baan
set BSE_COMPNR=200
D:\infor\fp7ln\bse\bin\startjob.bat REBUILD BALANCES
TASKKILL /IM cmd.exe


vinceco252 30th September 2014 18:50

I haven't tried this, but you can also change the batch file to use "~%1" instead of "%1" for the job argument and pass the argument as "TEST JOB". The "~" should remove the double quotes from the argument.

Vince

lebowski 1st October 2014 16:57

Thanks Bushan & Vince.

Unfortunately that didnt work.
Bushan's bat file works only if there is no blank in the job name and Vince's tip brings this message: JOB"" was unexpected at this time.

However, now I just copied the jobs to a new name with underscore (like TEST_JOB). I wasnt aware that all the sessions within the job are copied automatically - if I knew that before I wouldt have bothered you. I thought I have to inser all the sessions afterwards manually....

Thanks again & have a nice day.

lebowski

P.S.: Maybe it is because of Windows 2012

smusba 3rd June 2015 18:12

send me ur team viewer credentials and I will help you.
call me on 966-558802943

jbaanm 10th July 2017 20:29

Any of you can suggest how the command line will be in bwc file in windows to use the %1 as user and $2 as Job?

Thanks

Jay

rahul ingale 12th July 2017 20:38

@lebowski
@echo without space parameter %~1
pause
put above line in test file batch.

call this file as wherever the path like
f:\test\test.bat "test job" this will give output as
without space parameter test job

replace %1 to %~1 in batch file where it is used.


the tilde sign after percentange.
this will remove quotes from parameter.

call every job like startjob.bat "test job".

cons:-make sure you call job with quotes (space or without space job name).


All times are GMT +2. The time now is 09:22.


vB.Sponsors
©2001-2017 - Baanboard.com - Baanforums.com