I wonder if any of you out there could give me some pointers, the Head at the School where I work has asked if we could have a count down message appear on pupil desktops to tell them the number of days to go before a certain date (the Exams). I have used BGinfo in the past to display messages to users, is there a way we can do this with KIX/BGinfo?
Regards,
_________________________
Dont worry because a rival imitates you. As long as they follow in your tracks they cant pass you!
It's been like forever and a day since the last time I used BGInfo, so I had to look up its options ( http://technet.microsoft.com/en-us/sysinternals/bb897557 )It seems like to me you would just need to add a custom field that was would be used for a kix calulation. Assuming that the import file is text, open the file in kix, add the custom field with the calculated date, and save the changes. Then you would rerun the bginfo either by task scheduler or admin script to re-import the settings file.
I use serialdate for this type of thing... something like
Registered: 2003-01-28
Posts: 4396
Loc: New Jersey
Greetings!
BGInfo allows you to create a custom attribute. This can be the contents of a file or an environment var, among other options. Kix can easily create either - just make sure bginfo is called after Kix updates the value.
You can use one of the timediff() UDF to easily return the number of days between dates.. for example, if the exams start on Feb 15, 2010, you would run
Code:
$Days = TimeDiff('2/15/2012', 'Today', 'D')
Save the result, along with any other message, to a file or environment var
Code:
$ = RedirectOutput('C:\Temp\countdown.txt')
Int($Days) ' days before start of exams!'
$ = RedirectOutput('')
I tested this with BGInfo and the custom File attribute. The Int() is required because the TimeDiff will return the fractional day part.
Glenn
_________________________ Actually I am a Rocket Scientist!
Registered: 2002-03-27
Posts: 4672
Loc: The Netherlands
Originally Posted By: Stephen Wintle
Of course it doesn't have to use BGinfo if Kix can be used to do it all. Cheers.
Kix cannot display text on the user’s desktop without it being some kind of window like a command window, a custom made window using kixforms, etc... If you want it as text over the user’s desktop background then bginfo works fine. Been using it for some time and I do not have any complains yet.
A custom value like Glenn suggested should do the trick. It is not dynamic but it refreshes the value with whatever is in the text file every time the background is applied by BGInfo. If you want something dynamic then I suggest using a desktop gadget.
Hi Guys and thanks for the replies, it seems the solution is going to be a bit more complex than first thought, I have got BGinfo working and displaying a message etc. But I need to chop off weekends, holidays etc to calculate the actual working (school) days...
Ouch.
_________________________
Dont worry because a rival imitates you. As long as they follow in your tracks they cant pass you!
Hi, I need to calculate number of working days between to dates, (so miss weekends and holidays) looking at the Datecalc UDF is this possible? Then can I use a custom field in BGinfo to somehow automatically reduce the number by one?
The goal posts have moved..
_________________________
Dont worry because a rival imitates you. As long as they follow in your tracks they cant pass you!