+ Post New Thread
Page 1 of 2 12 LastLast
Results 1 to 15 of 26
Scripts Thread, Windows XP SP3 Cannot tell the time. in Coding and Web Development; I have installed Windows XP SP3. I have a logon script that will put a logo in the icon tray ...
  1. #1

    FN-GM's Avatar
    Join Date
    Jun 2007
    Location
    UK
    Posts
    15,390
    Thank Post
    797
    Thanked 1,588 Times in 1,391 Posts
    Blog Entries
    10
    Rep Power
    427

    Windows XP SP3 Cannot tell the time.

    I have installed Windows XP SP3. I have a logon script that will put a logo in the icon tray and with a balloon greet the user with good morning, good afternoon or good evening depending on the time of day. Since I have install XP SP3 the timing is all wrong. In the evening it displays as good morning in the morning it says nothing at all.
    It still works fine with Windows XP SP2.

    This is the code:

    Code:
    if time >"00:00:01" and time<"12:00:00" then timemessage = "Good morning " & objUser.firstname & ", welcome to the network"
    if time >"12:00:01" and time<"18:30:00" then timemessage = "Good afternoon " & objUser.firstname & ", welcome to the network"
    if time >"18:30:01" and time<"23:59:59" then timemessage = "Good evening " & objUser.firstname & ", welcome to the network"
    Message "HCHS", 1, timemessage, 4
    Any suggestions as to why please?

  2. #2

    Gatt's Avatar
    Join Date
    Jan 2006
    Posts
    6,540
    Thank Post
    831
    Thanked 609 Times in 412 Posts
    Rep Power
    432
    Is it a VBS Script?
    When i copy the code into notepad and save it as a vbs (time.vbs) i get the following error

    Script: C:\time.vbs
    Line: 4
    Char: 2
    Error: Type mismatch: 'Message'
    Code: 800A000D
    Source: Microsoft VBScript runtime error
    Dont think it likes "Message"

  3. #3

    FN-GM's Avatar
    Join Date
    Jun 2007
    Location
    UK
    Posts
    15,390
    Thank Post
    797
    Thanked 1,588 Times in 1,391 Posts
    Blog Entries
    10
    Rep Power
    427
    Yer is it you need to register a DLL and use this bit of code:

    Sub Message (strTitle, intIcon, strMessage, intSeconds)
    on error resume next
    If bTrayIcon = FALSE Then

    Set objTrayIcon = CreateObject ("SystemTray.Application")
    If Err.Number = 0 Then
    bTrayIcon = TRUE
    objTrayIcon.CreateIcon "\\server\NETLOGON\bin\hchs.ico", "HCHS"
    Else
    bTrayIcon = FALSE
    End If
    On Error Goto 0
    End If

    If bTrayIcon = TRUE Then
    Call objTrayIcon.ShowBalloon (CStr (strTitle), CInt (intIcon), CStr (strMessage))
    WScript.Sleep (intSeconds * 1000)
    Else
    on error resume next
    objShell.LogEvent 5-intIcon, "userstudentcheck.VBS wrote the following to the event log:" & vbCR & vbCR & "''" & strMessage & "''"
    End If

    End Sub
    If your interested in doing this in a script of your own I can post full details later on today if you like?

  4. #4

    Gatt's Avatar
    Join Date
    Jan 2006
    Posts
    6,540
    Thank Post
    831
    Thanked 609 Times in 412 Posts
    Rep Power
    432
    Yeah sounds like a nice little touch

  5. #5

    FN-GM's Avatar
    Join Date
    Jun 2007
    Location
    UK
    Posts
    15,390
    Thank Post
    797
    Thanked 1,588 Times in 1,391 Posts
    Blog Entries
    10
    Rep Power
    427
    Yes it is. I also managed to get the script to tell the user how many unread e-mails they have.

    I have got to do something at dinner time today i upload the code when i get back.

  6. Thanks to FN-GM from:

    Gatt (8th May 2008)

  7. #6
    reggiep's Avatar
    Join Date
    Apr 2008
    Location
    In the vast area of space and time
    Posts
    1,526
    Thank Post
    506
    Thanked 54 Times in 48 Posts
    Rep Power
    28
    Can I jump in on this thread and ask what I would need to do just to start using VB script for logins etc.
    I am now in a CC3 environmet but in my previous life I used kix script for login scripts.

  8. #7

    FN-GM's Avatar
    Join Date
    Jun 2007
    Location
    UK
    Posts
    15,390
    Thank Post
    797
    Thanked 1,588 Times in 1,391 Posts
    Blog Entries
    10
    Rep Power
    427
    I don’t work in a CC3 environment, just plain Windows. All you need for the plain Windows one is notepad to write to code then when the script is complete you place it in a group policy.

  9. #8

    FN-GM's Avatar
    Join Date
    Jun 2007
    Location
    UK
    Posts
    15,390
    Thank Post
    797
    Thanked 1,588 Times in 1,391 Posts
    Blog Entries
    10
    Rep Power
    427
    @Gatt do you use Exchange Server or Outlook for e-mails?

  10. #9

    Gatt's Avatar
    Join Date
    Jan 2006
    Posts
    6,540
    Thank Post
    831
    Thanked 609 Times in 412 Posts
    Rep Power
    432
    Exchange 2003 with OWA (Outlook 2007 next year)

  11. #10

    FN-GM's Avatar
    Join Date
    Jun 2007
    Location
    UK
    Posts
    15,390
    Thank Post
    797
    Thanked 1,588 Times in 1,391 Posts
    Blog Entries
    10
    Rep Power
    427
    OK the bit that tells you how many messages you have needs Outlook to be configured. But the script can also configure outlook for exchange automatically.

  12. #11

    SYNACK's Avatar
    Join Date
    Oct 2007
    Posts
    10,691
    Thank Post
    824
    Thanked 2,570 Times in 2,187 Posts
    Blog Entries
    9
    Rep Power
    731
    have you tried CDate("2:07:30 PM") as this will convert it to a date/time value manually rather that haphazardly if the scripting host feels like it.
    Last edited by SYNACK; 8th May 2008 at 10:28 AM.

  13. #12

    Michael's Avatar
    Join Date
    Dec 2005
    Location
    Birmingham
    Posts
    8,941
    Thank Post
    232
    Thanked 1,510 Times in 1,206 Posts
    Rep Power
    328
    Are the Date & Time and Time Zone set to GMT? As of course our American cousins operate MM/DD/YYYY whereas of course we use DD/MM/YYYY like everyone else!

  14. #13

    FN-GM's Avatar
    Join Date
    Jun 2007
    Location
    UK
    Posts
    15,390
    Thank Post
    797
    Thanked 1,588 Times in 1,391 Posts
    Blog Entries
    10
    Rep Power
    427
    Quote Originally Posted by SYNACK View Post
    have you tried CDate("2:07:30 PM") as this will convert it to a date/time value manually rather that haphazardly if the scripting host feels like it.
    How would i got about that please?

    Quote Originally Posted by Michael View Post
    Are the Date & Time and Time Zone set to GMT? As of course our American cousins operate MM/DD/YYYY whereas of course we use DD/MM/YYYY like everyone else!
    That bit is fine

    Thanks

  15. #14

    Michael's Avatar
    Join Date
    Dec 2005
    Location
    Birmingham
    Posts
    8,941
    Thank Post
    232
    Thanked 1,510 Times in 1,206 Posts
    Rep Power
    328
    What about Control Panel > Regional and Language Options. Is it all set to UK? (including the other tabs too).

  16. #15

    FN-GM's Avatar
    Join Date
    Jun 2007
    Location
    UK
    Posts
    15,390
    Thank Post
    797
    Thanked 1,588 Times in 1,391 Posts
    Blog Entries
    10
    Rep Power
    427
    Yes thats all fine.

    Z

SHARE:
+ Post New Thread
Page 1 of 2 12 LastLast

Similar Threads

  1. Windows Server 2003 - time server settings
    By CESIL in forum Windows
    Replies: 4
    Last Post: 22nd November 2007, 11:24 AM
  2. VBS File takes long time to load 1st time?
    By Samson in forum Scripts
    Replies: 3
    Last Post: 4th September 2007, 07:40 AM
  3. Windows Boot Time
    By Kained in forum Windows
    Replies: 20
    Last Post: 8th April 2007, 11:50 AM
  4. windows first time bootup tune
    By goodhead in forum Windows
    Replies: 7
    Last Post: 26th February 2007, 10:22 PM
  5. Who works term time only? How many full time?
    By gwendes in forum General Chat
    Replies: 45
    Last Post: 10th February 2007, 05:38 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •