Scheduling Jobs with windows
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 ?
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:-
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.
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.
P.S.: Maybe it is because of Windows 2012
send me ur team viewer credentials and I will help you.
call me on 966-558802943
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?
@echo without space parameter %~1
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 15:21.|
©2001-2017 - Baanboard.com - Baanforums.com