Link to home
Create AccountLog in
Avatar of Steve B
Steve BFlag for Australia

asked on

Create a timed note / application to run on Windows 7 when Logging on

I don't know if this is possible, but I was wondering if there is a way to have a note or little private news feed automatically shows up on my two staff members workstations when new information or any special news that my staff need to know about.

I want the note or news to pop up automatically when they log into their computer.

I am using a simple network system that has one file Server and 3 workstations that are connected to the file server (which is really just another PC running Windows 7) and all the computers are connected via a router.

Is this possible, if it is, how can I do it?
Avatar of David Johnson, CD
David Johnson, CD
Flag of Canada image

scheduled tasks, trigger run on user logon, the actual task could be as simple as notepad.exe \\server\share\notes.txt
Avatar of Steve B

ASKER

How could I have this as a timed event.  So it only shows it for a day or two?

Also would could this be used for each workstation and would I have to create a notepad.txt for each workstation or could I just do one - and have it show up on each workstation when they log on?
The scheduled task would have to be on each workstation but the actual message only has to be on a a shared resource that all users can access.

again using a schedulded task that has the trigger of running on user logon..

Another way is to create a vbscript program.
have the vbscript/powershell script check for the existence of a file in \\server\share\ that is today's date.txt i.e. 10112012.txt
If this file exists then display a message box that has the contents of this file.. If the file does not exist silently exit.

depending upon the style of the message box the user can be prompted to click ok, or close it.. yes,no,cancel.. to many options to list.. personally I'd go with the msgbox route over notepad. The actual coding is trivial code for a vbscript/powershell programmer.

the actual script can be on a shared resource (file share) as well.  Are you in a domain environment or a workgroup?
Avatar of Steve B

ASKER

I believe I am in workgroup.

Would you be able to create that  vbscript/powershell thing?
dim filesys, text, readfile, contents
Dim Share 
Dim Filename
' Modify the Share to a Valid Share on your Network
Share = "\\davidjohnson-w7\downloads\" 
' Filename is DAY-MONTH-YEAR dd-mm-yyyy
Filename = Day(Date) & "-" & Month(Date) & "-" & Year(Date) & ".txt"
Set filesys = CreateObject("Scripting.FileSystemObject")
MyFile = Share & Filename
'WScript.Echo Share
'uncomment (remove the ' to debug the filename
'WScript.Echo Filename
'WScript.Echo MyFile

'
If filesys.FileExists(MyFile) Then
   set readfile = filesys.OpenTextFile(MyFile, 1, false)
   contents = readfile.ReadAll
   readfile.Close
   result=Msgbox(contents,vbOKOnly +vbInformation, "Message of the Day")
WScript.Echo result
End If

Open in new window

Avatar of Steve B

ASKER

Thank you. I do have a few more questions.

1) I take it that I meant to copy the script and save it somewhere? The question is where do I paste the script and what do I save it as?

2) where should this file be saved at?

3) How do the other workstations read the text message? Where is the text message supposed to be saved in?

4) What application should I use to create the text messages?

5) What do you mean by
'uncomment (remove the ' to debug the filename?

Will wait for your reply.
1) I take it that I meant to copy the script and save it somewhere? The question is where do I paste the script and what do I save it as?

you-can-name-it-anything-you-want.vbs


2) where should this file be saved at?

You can save it to a file share

3) How do the other workstations read the text message? Where is the text message supposed to be saved in?


my machines name is davidjohnson-w7  and I've shared my D:\downloads as "downloads" so to access this directory from my local network it is \\davidjohnson-w7\downloads
Line 5: Share = "\\davidjohnson-w7\downloads\"
Change this to reflect your share folder's settings

4) What application should I use to create the text messages?

Notepad works fine.

5) What do you mean by 'uncomment (remove the ' to debug the filename?
If you want the script to display the filename that it is looking for remove the ' and save the file again and then double click it. Note: this is set to look for a file that has the name that reflects the current date. It doesn't show yesterdays files, if you want you can create files with names that reflect events in the future. i.e.
25-12-2012.txt could contain 'Merry Christmas' and when someone logs on it will display that text.
10-11-2012.txt
ee-nov10-2012.vbs
Avatar of Steve B

ASKER

What do mean by save it to a file share?

The way I have my workstations setup is very simple. I run a PC that has to specific folders that are shared folders. The other three workstations simply connect to this PC and have access to the staff folder and the other shared folder.

So when you say "save it to a file share" what or where are you referring to?

Also my network drive is Staff_2216_Office (\\ICONICMAINSERVE)

If I save this vbs file here, then couldn't tge staff accidentally delete it?
Create a new share that they don't have write access
It can be ANY folder on \\ICONICMAINSERVE
how to add the task in taskmanager video
Avatar of Steve B

ASKER

Thank you it worked.

One more question though ...
Is it possible to have the follow internet page open up automatically - maximum size - each time they log in as well

http://staff.iconicperformances.com.au
Set objIE=WScript.createobject("internetexplorer.application","objIE")
objIE.visible = True
objIE.TheaterMode = False
objIE.AddressBar = True
objIE.StatusBar = False
objIE.MenuBar = True
objIE.FullScreen = True
objIE.Navigate "about:blank"
Do Until objIE.ReadyState = 4
WScript.Sleep 100
Loop
Set shl = WScript.CreateObject("WScript.Shell")
shl.SendKeys "% X" 
URL = "http://staff.iconicperformances.com.au"
objIE.Navigate(URL)

Open in new window

10-nov2012-ie-max.vbs
Avatar of Steve B

ASKER

Thank you. Do i put this in the same shared folder?
Might as well, use the same procedure to add a new task to scheduled tasks.
Avatar of Steve B

ASKER

Thank you it works. There are two problems however ...

1) The IE opens up as a full screen - taking up all the screen including the taskbar etc.  I was hoping that it was just a maximised page, that displayed the titlebar, statusbar etc and that was not necessarily the whole screen - as the start button disappears, so does the time clock etc.  

2) the vbscript only works if the user logs off and logs on.  I don't get my staff to do that as they have so many different applications on.  They only Lock their computer and then when they return they log in using their password.

Are these two things fixable?
Avatar of Steve B

ASKER

Okay I found how to fix question (2).

The thing I have found now is that each time the user logs in after each unlock the vbscript will start a new IE page with the same URL.

Is it possible, that when a user logs in, the vbscript checks to see if the URL is present.  If it is opened, then it just brings it to the front of the screen.  If it isn't present (opened) then it opens it.
ASKER CERTIFIED SOLUTION
Avatar of David Johnson, CD
David Johnson, CD
Flag of Canada image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of Steve B

ASKER

Okay. Thanks. Much appreciated
Avatar of Steve B

ASKER

When the original date script runs, it leaves a window titled "Windows Script Host" and in the box there is always a 1

What is this and can we delete it or stop it from happening?
change line 21: WScript.Echo result
to
if result =1 then WScript.Quit
Avatar of Steve B

ASKER

Great - all fixed.  Thank you once again.