Page 1 of 1 1
Topic Options
#41840 - 2003-06-19 05:52 PM Lots O Questions (sorry)
Keith W. Offline
Fresh Scripter

Registered: 2003-06-06
Posts: 30
Loc: Brandon, MB
Well I regret to say that I am here with more questions =(.... it seems to be all take and no give with me.

Here are some of the things I am trying to do with my scripts:

1. I want to have a sort of countdown to a certain day. something like: "Only XXX days until the annual Corporate Conference" I have looked at a bunch of the UDF's and quite frankly I have no idea what the deal is with Julian and Gregorian dates are.

2. Is there a key in the registry where a users homepage is stored?

3. In my scripts I had some call's... i.e. "call drives.kix". Drives.kix is located on the logonserver. Now with NT and 2K this worked no problem but with XP I have to specify the UNC name of the file, i.e. "\\server\netlogon\drives.kix". Is this normal?

EDIT:

Ok some updates....

1. All I need to know is how to get the current date from the comp preferrably in YYYY/MM/DD format.

2. I think I have found the key so you can disregard this one.

3. Still clueless.

[ 19. June 2003, 18:25: Message edited by: Keith W. ]

Top
#41841 - 2003-06-19 07:20 PM Re: Lots O Questions (sorry)
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Keith, surprised this post is langishing ...

1) Probably need more info to go on here. You want to have some kind of central INI file with date and messages ? Like this:

[bday]
date = 2003/09/07
event = "Shawns birthday"

[jlo]
date = 2075/01/01
event = "Jooel stops using Linux"

[BadGUID]
date = 3590/01/01
event = "MS GUIDs start to wrap"

Then, in the login script, determine how many days until event and display message ?

2) For the home page, think this what your after:

HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\Start Page

-Shawn

[ 19. June 2003, 19:22: Message edited by: Shawn ]

Top
#41842 - 2003-06-19 07:37 PM Re: Lots O Questions (sorry)
MightyR1 Offline
MM club member
*****

Registered: 1999-09-09
Posts: 1264
Loc: The Netherlands
[Big Grin] [Big Grin] [Big Grin]
quote:
event = "Jooel stops using Linux"
Funny guy you are Shawn...
_________________________
Greetz,
Patrick Rutten

- We'll either find a way or make one...
- Knowledge is power; knowing how to find it is more powerful...
- Problems don't exist; they are challenges...

Top
#41843 - 2003-06-19 07:40 PM Re: Lots O Questions (sorry)
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
wahey, so someone is awake out there [Wink] actually, think MS GUIDs will wrap before Jooel stops using Linux.
Top
#41844 - 2003-06-19 07:47 PM Re: Lots O Questions (sorry)
Keith W. Offline
Fresh Scripter

Registered: 2003-06-06
Posts: 30
Loc: Brandon, MB
What I want to do is exactly this:

The Annual Corporate Conference this year is Sept. 22nd.

I want my script to display a message saying: "Only XX days until the Annual Corporate Conference"

so what I would need to do is get the current date from the computer and subtract the date of the conference to end up with the amount of days until the conference. I am also looking at another way of doing it which would involve simply manually counting the number of days and then making the script just subtract 1 each day.

Top
#41845 - 2003-06-19 07:53 PM Re: Lots O Questions (sorry)
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Have you looked in the manual for date macros?
quote:
@YDayNo Days since January 1 (1 – 365)
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#41846 - 2003-06-19 07:59 PM Re: Lots O Questions (sorry)
Keith W. Offline
Fresh Scripter

Registered: 2003-06-06
Posts: 30
Loc: Brandon, MB
Good god..... I suck at this.... first post I get reemed because there is a UDF for what I want to do.... so this time I search my @ss off for a UDF and now a simple macro may work! Well it wont do exactly what I want but I think I can make my own UDF for it.
Top
#41847 - 2003-06-19 08:34 PM Re: Lots O Questions (sorry)
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
what comes to linux...
we will see.
if our @-series will come with it, I need to stick with it too.
anyway, I plan on turning back to the good old unix via netBSD...

anyway, it also might indeed be that my stop for using linux is the day I die.
_________________________
!

download KiXnet

Top
#41848 - 2003-06-19 10:14 PM Re: Lots O Questions (sorry)
Bryce Offline
KiX Supporter
*****

Registered: 2000-02-29
Posts: 3167
Loc: Houston TX
Keith look for the UDF SerialDate() in the UDF forums. It will do what you want.

code:
? "There are " + (serialdate("2003/09/22") - serialdate(@date)) + " days till 2003/09/22"

as for your calling problem, try the @scriptdir macro.

call "@scriptdir\drives.kix"

Top
#41849 - 2003-06-19 11:11 PM Re: Lots O Questions (sorry)
Keith W. Offline
Fresh Scripter

Registered: 2003-06-06
Posts: 30
Loc: Brandon, MB
Thanks bryce but i have already done it a different way. I just found out the number of days from Jan 1 to Sept. 22 (265) and used that to get a formula like so:

$date = 265 - @ydayno

It gets the job done =). I think I'm gonna sit down and read up on all the macros before I ask another question.... although in my defence I am busy working on roaming profiles and other stuff so I havent had much time to look at the documentation.

Top
#41850 - 2003-06-19 11:23 PM Re: Lots O Questions (sorry)
MightyR1 Offline
MM club member
*****

Registered: 1999-09-09
Posts: 1264
Loc: The Netherlands
Keith,

make sure you're script doesn't display the message after the target date was reached or you could get messages saying "Only -13 days until the annual Corporate Conference" [Wink]

So (not tested):

code:
cls break on
$dif=265-@ydayno
$str1='Only '
$str2='until the annual Corporate Conference.'
$str=''
select
case $dif=0
$str='Whahoo, Let's Party!!!'
case $dif=1
$str=$str1+'1 day '+$str2
case $dif>1
$str=$str1+$dif+' days '+$str2
case 1
endselect
if $str<>''
$rc=messagebox($str,'?? Party Time ??')
endif
exit 0

_________________________
Greetz,
Patrick Rutten

- We'll either find a way or make one...
- Knowledge is power; knowing how to find it is more powerful...
- Problems don't exist; they are challenges...

Top
#41851 - 2003-06-20 04:55 AM Re: Lots O Questions (sorry)
Keith W. Offline
Fresh Scripter

Registered: 2003-06-06
Posts: 30
Loc: Brandon, MB
Actually I just did a simple:

if $date > 0
? "Only " $date "days till......."
EndIf

Top
#41852 - 2003-06-20 11:02 AM Re: Lots O Questions (sorry)
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11634
Loc: Space
Keith,
If you take a look in the FAQ section on this board about XP you'll find an
explanation of why it is your XP systems can not find your drives.kix file.
(at least I think this may be your issue)
But, then again, maybe Bryce gave you the answer already.

If you do not have any Windows 9x systems then you don't need to use a batch
file at all. You can simply run either

KIX32.EXE KIXTART.KIX
or
WKIX32.EXE KIXTART.KIX

Then there should not be an issue calling the DRIVES.KIX file, but you could
also include all the code in a single file and run it that way.

Windows 9x is the one that gets lost and does not know where it is in the
environment. NT/2000/XP/2003 do not have this problem, thus there is no
need to launch KiXtart with a batch file for these systems.

As for the COUNT DOWN TIMER I think this may be a better solution.






break on
$Date="2003/09/22"
$EventDay=(serialdate($Date) - serialdate(@date))

SELECT
CASE
$EventDay >0
? "There are " + $EventDay + " days till The Annual Corporate Conference this year on Sept. 22nd"
CASE
$EventDay <0
? "The Annual Corporate Conference passed by " + $EventDay + " day/s ago."
CASE
$EventDay =0
? "The Annual Corporate Conference is " BIG "TODAY" SMALL
ENDSELECT

function serialdate($ExpD)
dim $z,$h,$a,$b,$c,$y,$m,$d
if instr($ExpD,'/')
$ExpD=split($ExpD,'/')
$y=val($ExpD[0])
$m=val($ExpD[1])
$d=val($ExpD[2])
if $m<3
$m=$m+12
$y=$y-1
endif
$SerialDate=$d+(153*$m-457)/5+365*$y+$y/4-$y/100+$y/400-306
else
$z=0+$ExpD+306
$h=100*$z-25
$a=$h/3652425
$b=$a-$a/4
$y=(100*$b+$h)/36525
$c=$b+$z-365*$y-$y/4
$m=(5*$c+456)/153
$d=$c-(153*$m-457)/5
if $m>12
$y=$y+1
$m=$m-12
endif
$SerialDate=right('0000'+$y,4)+'/'+right('00'+$m,2)+'/'+right('00'+$d,2)
endif
endfunction




[ 20. June 2003, 11:09: Message edited by: NTDOC ]

Top
#41853 - 2003-06-21 04:31 AM Re: Lots O Questions (sorry)
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11634
Loc: Space
Just a minor change to the code. For the days before the event it shows in the DOS box
during logon, when the day arrives it POPS UP a MessageBox for more attention. Then when
event is passed it goes back to the DOS box until you disable it in the script.

Now that the code is working and readily available, I may have to use it for something myself.






break on
$Date="2003/06/20"
$EventDay=(serialdate($Date) - serialdate(@date))

SELECT
CASE
$EventDay >0
? "There are " + $EventDay + " days till The Annual Corporate Conference this year on Sept. 22nd"
CASE
$EventDay <0
? "The Annual Corporate Conference passed by " + $EventDay + " day/s ago."
CASE
$EventDay =0
$EM=Messagebox('The Annual Corporate Conference is TODAY'+@crlf+@crlf+'
'
+@date, 'Corporate Event', 64, 10)
ENDSELECT

function serialdate($ExpD)
dim $z,$h,$a,$b,$c,$y,$m,$d
if instr($ExpD,'/')
$ExpD=split($ExpD,'/')
$y=val($ExpD[0])
$m=val($ExpD[1])
$d=val($ExpD[2])
if $m<3
$m=$m+12
$y=$y-1
endif
$SerialDate=$d+(153*$m-457)/5+365*$y+$y/4-$y/100+$y/400-306
else
$z=0+$ExpD+306
$h=100*$z-25
$a=$h/3652425
$b=$a-$a/4
$y=(100*$b+$h)/36525
$c=$b+$z-365*$y-$y/4
$m=(5*$c+456)/153
$d=$c-(153*$m-457)/5
if $m>12
$y=$y+1
$m=$m-12
endif
$SerialDate=right('0000'+$y,4)+'/'+right('00'+$m,2)+'/'+right('00'+$d,2)
endif
endfunction


Top
Page 1 of 1 1


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

Who's Online
0 registered and 735 anonymous users online.
Newest Members
JimDunn, fgarcia, Viginette, ManuvdWielNL, Sir_Barrington
17890 Registered Users

Generated in 0.114 seconds in which 0.073 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