+ Post New Thread
Results 1 to 14 of 14
Scripts Thread, Display a message in Coding and Web Development; Hi this has been discussed before but I cannot find what I am looking for I am after a script ...
  1. #1

    FN-GM's Avatar
    Join Date
    Jun 2007
    Location
    UK
    Posts
    16,232
    Thank Post
    894
    Thanked 1,780 Times in 1,534 Posts
    Blog Entries
    12
    Rep Power
    462

    Display a message

    Hi this has been discussed before but I cannot find what I am looking for

    I am after a script that will display a message when a user logs in, please can someone point me in the right direction please?

    Thanks

  2. #2

    Join Date
    Mar 2006
    Posts
    537
    Thank Post
    2
    Thanked 3 Times in 2 Posts
    Rep Power
    19

    Re: Display a message

    Do a forum search for "message of the day"

  3. #3

    maniac's Avatar
    Join Date
    Feb 2007
    Location
    Kent
    Posts
    3,070
    Thank Post
    210
    Thanked 430 Times in 310 Posts
    Rep Power
    144

    Re: Display a message

    I just use the VBscript msgbox function;
    Code:
    msgbox "This is my message",4096,"Title of message box"
    The 4096 makes the message box a system model, which means the user can't do anything unless they click OK. The other available options are explained in this article;
    http://www.w3schools.com/vbscript/func_msgbox.asp

    I've several scripts that display messages to users, e.g. if they are banned from the internet in my school, they get a message telling them at logon.

    It's possible to make this much more elaborate and have a yes/no response for the user to agree to an AUP before they can do anything and if they don't agree for them to be logged off, but for a basic message box, the above will do it.

    Mike.

  4. #4

    mattx's Avatar
    Join Date
    Jan 2007
    Posts
    9,240
    Thank Post
    1,058
    Thanked 1,069 Times in 625 Posts
    Rep Power
    740

    Re: Display a message

    AutoIT:

    Code:
    MsgBox(64,"Message Of The Day","Test For Message Of The Day")
    Will show:


  5. Thanks to mattx from:

    FN-GM (15th February 2008)

  6. #5

    FN-GM's Avatar
    Join Date
    Jun 2007
    Location
    UK
    Posts
    16,232
    Thank Post
    894
    Thanked 1,780 Times in 1,534 Posts
    Blog Entries
    12
    Rep Power
    462

    Re: Display a message

    @ Mattx what format do you save it as please?

    @ITWombat i did do.

    @maniac thanks for the link

    Thank You

    Z

  7. #6

    Join Date
    Jul 2005
    Location
    Worthing, West Sussex
    Posts
    876
    Thank Post
    22
    Thanked 77 Times in 72 Posts
    Rep Power
    35

    Re: Display a message

    AutoIt Scripts need to be compiled with AutoIt, or run through an interpreter.

    For an easier time, put maniac's code into notepad, and save it as a text file with .vbs as the extension - then it'll just work!

  8. #7

    FN-GM's Avatar
    Join Date
    Jun 2007
    Location
    UK
    Posts
    16,232
    Thank Post
    894
    Thanked 1,780 Times in 1,534 Posts
    Blog Entries
    12
    Rep Power
    462

    Re: Display a message

    Hi

    Thats what i ahve done, works good

    Thanks

  9. #8

    FN-GM's Avatar
    Join Date
    Jun 2007
    Location
    UK
    Posts
    16,232
    Thank Post
    894
    Thanked 1,780 Times in 1,534 Posts
    Blog Entries
    12
    Rep Power
    462
    Hi

    How would I make it so the message will disappear in 5 seconds & can i use some code to display the users name? For example %firstname% or %username%

    Thanks Allot

  10. #9

    mattx's Avatar
    Join Date
    Jan 2007
    Posts
    9,240
    Thank Post
    1,058
    Thanked 1,069 Times in 625 Posts
    Rep Power
    740
    Under AutoIT use the @UserName macro

  11. Thanks to mattx from:

    FN-GM (15th February 2008)

  12. #10

    FN-GM's Avatar
    Join Date
    Jun 2007
    Location
    UK
    Posts
    16,232
    Thank Post
    894
    Thanked 1,780 Times in 1,534 Posts
    Blog Entries
    12
    Rep Power
    462
    Thanks

    How would i put a timeout on it please? Also is it possible to display the users first name only?

    Z

  13. #11

    Join Date
    Jul 2007
    Location
    Devon
    Posts
    233
    Thank Post
    8
    Thanked 9 Times in 8 Posts
    Rep Power
    16
    AFAIK in VB, you'll need to use an ADSI query to grab that stuff...(so I didn't bother)

    I don't use the msgbox function for popups when I did my logon script...

    I used the Windows Shell Popup...

    oWSH = CreateObject("WScript.Shell")

    oWSH.Popup "my message", 5, "title"

    5 = 5 seconds...

    looks like a normal msgbox... not sure what other properties it can have though, never really looked into it..

  14. #12

    FN-GM's Avatar
    Join Date
    Jun 2007
    Location
    UK
    Posts
    16,232
    Thank Post
    894
    Thanked 1,780 Times in 1,534 Posts
    Blog Entries
    12
    Rep Power
    462
    Quote Originally Posted by Lithium View Post
    AFAIK in VB, you'll need to use an ADSI query to grab that stuff...(so I didn't bother)

    I don't use the msgbox function for popups when I did my logon script...

    I used the Windows Shell Popup...

    oWSH = CreateObject("WScript.Shell")

    oWSH.Popup "my message", 5, "title"

    5 = 5 seconds...

    looks like a normal msgbox... not sure what other properties it can have though, never really looked into it..

    Is that all the code it doesn't appear to work.

    Thanks

  15. #13

    Join Date
    Feb 2008
    Location
    UK
    Posts
    44
    Thank Post
    0
    Thanked 1 Time in 1 Post
    Rep Power
    0
    Code:
    Dim oWSH
    Set oWSH = CreateObject("WScript.Shell")
    oWSH.Popup "my message", 5, "title"

  16. #14

    FN-GM's Avatar
    Join Date
    Jun 2007
    Location
    UK
    Posts
    16,232
    Thank Post
    894
    Thanked 1,780 Times in 1,534 Posts
    Blog Entries
    12
    Rep Power
    462
    Lovely, Thanks alot.

    I might be pushing it here, how can i get the username, e-mail address etc in please?

    Thanks
    Last edited by FN-GM; 15th February 2008 at 10:42 PM.

SHARE:
+ Post New Thread

Similar Threads

  1. Nagios Display
    By plexer in forum How do you do....it?
    Replies: 4
    Last Post: 17th July 2007, 07:43 PM
  2. X display problem
    By Ric_ in forum *nix
    Replies: 17
    Last Post: 22nd May 2007, 02:48 PM
  3. plasma display
    By cooper in forum Recommended Suppliers
    Replies: 3
    Last Post: 21st May 2007, 02:41 PM
  4. Replies: 2
    Last Post: 29th January 2007, 03:25 PM
  5. Display a message whilst installing software
    By richard in forum How do you do....it?
    Replies: 14
    Last Post: 14th December 2006, 01:40 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
  •