+ Post New Thread
Page 1 of 2 12 LastLast
Results 1 to 15 of 17
How do you do....it? Thread, Message of the day application in Technical; Do you use a message of the day pop-up to convey information e.g. maintenance information. Do you use a login ...
  1. #1

    Join Date
    Feb 2006
    Posts
    1,187
    Thank Post
    0
    Thanked 1 Time in 1 Post
    Rep Power
    0

    Message of the day application

    Do you use a message of the day pop-up to convey information e.g. maintenance information.

    Do you use a login script or dedicated app?

  2. #2

    Sylv3r's Avatar
    Join Date
    Jul 2005
    Location
    Co. Durham
    Posts
    3,203
    Thank Post
    372
    Thanked 376 Times in 334 Posts
    Rep Power
    147

    Re: Message of the day application

    I used something knocked up in visual basic. It is located on a shared drive and when a user logs on the script checks to see if the file exists. If it does it shows the message i.e. "USB Memory Pens for sale etc" with jpg or whatever. If the file doesnt exist nothing will be shown.

  3. #3

    plexer's Avatar
    Join Date
    Dec 2005
    Location
    Norfolk
    Posts
    13,343
    Thank Post
    624
    Thanked 1,584 Times in 1,421 Posts
    Rep Power
    414

    Re: Message of the day application

    Here's a vbs that will do the same thing reading from a text file if the file is empty nothing is displayed.

    Set objFSO = CreateObject("Scripting.FileSystemObject")
    Set objFile = objFSO.GetFile("C:\motd.txt")
    If objFile.Size > 0 Then
    Set objReadFile = objFSO.OpenTextFile("C:\motd.txt", 1)
    strContents = objReadFile.ReadAll
    Wscript.Echo strContents
    objReadFile.Close
    Else
    End If
    Ben

  4. #4

    Join Date
    Feb 2006
    Posts
    1,187
    Thank Post
    0
    Thanked 1 Time in 1 Post
    Rep Power
    0

    Re: Message of the day application

    Won't that result in a lot of message boxes?
    one for each line

  5. #5

    plexer's Avatar
    Join Date
    Dec 2005
    Location
    Norfolk
    Posts
    13,343
    Thank Post
    624
    Thanked 1,584 Times in 1,421 Posts
    Rep Power
    414

    Re: Message of the day application

    Nope one message box displaying the contents of the file.

    Ben

  6. #6
    ChrisH's Avatar
    Join Date
    Jun 2005
    Location
    East Lancs
    Posts
    4,999
    Thank Post
    120
    Thanked 280 Times in 258 Posts
    Rep Power
    106

    Re: Message of the day application

    No the line :

    Code:
    strContents = objReadFile.ReadAll
    Is dumping the whole file into one variable.

  7. #7

    Join Date
    Feb 2006
    Posts
    1,187
    Thank Post
    0
    Thanked 1 Time in 1 Post
    Rep Power
    0

    Re: Message of the day application

    Quote Originally Posted by ChrisH
    No the line :

    Code:
    strContents = objReadFile.ReadAll
    Is dumping the whole file into one variable.
    ops:

  8. #8

    plexer's Avatar
    Join Date
    Dec 2005
    Location
    Norfolk
    Posts
    13,343
    Thank Post
    624
    Thanked 1,584 Times in 1,421 Posts
    Rep Power
    414

    Re: Message of the day application

    Dim StrUsername, Strfilename, Strcomputername, Strmsglocation

    Strmsglocation = "c:\"
    Set objNetwork = WScript.CreateObject("WScript.Network")
    strUserName = objNetwork.UserName
    strcomputername =objNetwork.ComputerName

    Set objFSO = CreateObject("Scripting.FileSystemObject")
    if objFso.FileExists(Strmsglocation & "motd.txt") then
    strfilename = Strmsglocation & "motd.txt"
    else
    strfilename = Strmsglocation & "null.txt"
    end if
    Set objFile = objFSO.GetFile(strfilename)
    If objFile.Size > 0 Then
    Set objReadFile = objFSO.OpenTextFile(strfilename, 1)
    strContents = objReadFile.ReadAll
    Wscript.Echo strContents
    objReadFile.Close
    Else
    End If


    if objFso.FileExists(Strmsglocation & strusername & ".txt") then
    strfilename = Strmsglocation & strusername & ".txt"
    else
    strfilename = Strmsglocation & "null.txt"
    end if
    Set objFile = objFSO.GetFile(strfilename)
    If objFile.Size > 0 Then
    Set objReadFile = objFSO.OpenTextFile(strfilename, 1)
    strContents = objReadFile.ReadAll
    Wscript.Echo strContents
    objReadFile.Close
    Else
    End if

    if objFso.FileExists(Strmsglocation & strcomputername & ".txt") then
    strfilename = Strmsglocation & strcomputername & ".txt"
    else
    strfilename = Strmsglocation & "null.txt"
    end if
    Set objFile = objFSO.GetFile(strfilename)
    If objFile.Size > 0 Then
    Set objReadFile = objFSO.OpenTextFile(strfilename, 1)
    strContents = objReadFile.ReadAll
    Wscript.Echo strContents
    objReadFile.Close
    Else
    End if
    I've done a steroids version of the motd.vbs now you can show 3 messages the first is the normal message of the day, the second is specific to a username and the third is specific to a computer.

    You set the location of the files at the top of the script in the:
    Strmsglocation = "c:\"

    Variable.

    Wherever you set that to you need to create a text file called null.txt with nothing in it.

    motd.txt is the one you create for a system wide message of the day.

    The other 2 would be username.txt and computername.txt where username and computername are the particular ones you want to message. i.e 00test.txt or 18-01.txt

    What might be also useful is to have a group feature so that you could have say 18.txt and every machine in 18 would get the message.

    Hope this is useful to someone.

    Ben

  9. #9

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

    Re: Message of the day application

    How about this:

    Attach the user motd to the relvant user init GPO

    or

    Attach the computer script to a loopack GPO for the OU which groups together the computers in a PC suite.

  10. #10

    plexer's Avatar
    Join Date
    Dec 2005
    Location
    Norfolk
    Posts
    13,343
    Thank Post
    624
    Thanked 1,584 Times in 1,421 Posts
    Rep Power
    414

    Re: Message of the day application

    Yes you could do those but then you have different copies of the motd script rather than just being able to have a bunch of .txt's in a folder.

    Ben

  11. #11

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

    Re: Message of the day application

    Yeah. You have point there. To do group selection in monOlithic script you'd have t o use ADSI, KiXtart or string splitting in VBS.

  12. #12

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

    Re: Message of the day application

    Nice and simple AutoIT script. Just 9 lines of code to do this sort of thing.

    ; AutoIt Version: 3
    ; Language: English
    ; Platform: WinXP
    ; Author: Matt Marsh
    ; Script Function: Message Of The Day Program

    $__msgbox = MsgBox(64, 'St Johns Network Message Of The Day', _
    'Test message for the St Johns Network Message Of The Day Program.' & @CRLF & _
    @CRLF & _
    'Matt Marsh - IT Tech' & @CRLF & _
    @CRLF & _
    'Click on OK to close this box.')
    if ($__msgbox = 1) Then
    Exit
    EndIf
    Will show this:



    Compile it to an EXE and run it at logon.

  13. #13

    plexer's Avatar
    Join Date
    Dec 2005
    Location
    Norfolk
    Posts
    13,343
    Thank Post
    624
    Thanked 1,584 Times in 1,421 Posts
    Rep Power
    414

    Re: Message of the day application

    Nice and short but then you have to recompile it everytime you want to change the message?

    Ben

  14. #14

    Geoff's Avatar
    Join Date
    Jun 2005
    Location
    Fylde, Lancs, UK.
    Posts
    11,803
    Thank Post
    110
    Thanked 583 Times in 504 Posts
    Blog Entries
    1
    Rep Power
    224

    Re: Message of the day application

    I use the venerable wFortune.

    http://www.progsoc.uts.edu.au/~timj/wfortune/

  15. #15

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

    Re: Message of the day application

    Nice and short but then you have to recompile it everytime you want to change the message?
    Which takes seconds, which you can also do in Scite, or even just right clicking over the script.

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

Similar Threads

  1. Application packaging
    By ajbritton in forum Courses and Training
    Replies: 3
    Last Post: 18th August 2010, 02:04 PM
  2. GPO application.
    By starscream in forum Windows
    Replies: 2
    Last Post: 30th July 2007, 10:39 AM
  3. add an application
    By colin in forum Learning Network Manager
    Replies: 6
    Last Post: 20th December 2006, 11:57 AM
  4. Keep an application open
    By adamyoung in forum How do you do....it?
    Replies: 10
    Last Post: 6th June 2006, 07:29 PM
  5. Application Server
    By woody in forum Hardware
    Replies: 2
    Last Post: 6th March 2006, 10:58 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
  •