Page 1 of 1 1
Topic Options
#57833 - 2001-08-01 09:25 PM Use of @DAY
slp333 Offline
Fresh Scripter

Registered: 2001-08-01
Posts: 7
Currently I am using the "@DAY = Tuesday"to run an executable. Is there a way to run this once a month instead of once a week on Tuesdays?

Thanks

Top
#57834 - 2001-08-01 10:39 PM Re: Use of @DAY
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Welcome JimJam,

@mdayno would fit once a month ...

Jochen

_________________________



Top
#57835 - 2001-08-01 10:48 PM Re: Use of @DAY
slp333 Offline
Fresh Scripter

Registered: 2001-08-01
Posts: 7
If I use @mdayno, will I have to manually go into the script and edit the month each time for each month?

If the 1st day of the month falls on a Sunday, will the executable still run on the next available monday?

Top
#57836 - 2001-08-01 10:51 PM Re: Use of @DAY
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
ouch !

You're right jimjam ... just a tick, I'll be back with some code

J.


ps.: Got that right ? Job shall run on first of each month except it's saturday or sunday ?

[ 01 August 2001: Message edited by: jpols ]

_________________________



Top
#57837 - 2001-08-01 11:13 PM Re: Use of @DAY
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
and back again ...

the following uses an ini-file on the client computer to check if the executable has already been run on the client :

(Side Note : if the ini doesn't exist it'll be created automatically )

code:

$ini = 'c:\chk.ini'
if exist($ini) = 0
$run = writeprofilestring($ini,"LastRun","Executed","never")
else
$run = readprofilestring($ini,"LastRun","Executed")
endif
if $run = 0 or $run <> @month
shell 'your executable'
if @error = 0 ; or whatever it returns !
$ = writeprofilestring(($ini,"LastRun","Executed",@month)

endif
endif


Good enough ?

Jochen


PS.: unchecked 'cos I'm @home right now ...

[ 01 August 2001: Message edited by: jpols ]

_________________________



Top
#57838 - 2001-08-01 11:28 PM Re: Use of @DAY
slp333 Offline
Fresh Scripter

Registered: 2001-08-01
Posts: 7
Thanks Jochen, will test and see if completes
Top
#57839 - 2001-08-02 07:27 PM Re: Use of @DAY
slp333 Offline
Fresh Scripter

Registered: 2001-08-01
Posts: 7
Thanks

Worked Fine!!

You da man!

Top
Page 1 of 1 1


Moderator:  Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 1046 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.056 seconds in which 0.025 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org