Adding messages to Win7 logon screen

1

I am following the tutorial here in order to change to logon screen, it's working so far. However I would like a little more functionality if possible.

I am able to display a title by editing the following reg key;

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System

legalnoticecaption

I can also add a message by editing

legalnoticetext 

I would now like another notice to say "This computer has been locked for x minutes".

What do I need to edit/create in order to achieve this? Is this even possible?

The reason for doing this is because in our lab some of the PCs are being locked and users are simply walking away from them. They do logout after 30 minutes, however I would like to clearly display to other passing users how long a PC has been locked.

jonboy

Posted 2015-05-22T09:21:38.197

Reputation: 209

Answers

1

Straight off the bat - this isn't natively possible.

HOWEVER! it may be possible through a script.

Theoretically, you could write a small piece of VBScript to update the registry key every minute or two minutes with a new value by reading the screensaver start time.

This Scripting guy post shows you how to read when a screensaver kicked in. If you do a date/time diff and find the elapsed time - you should be able to update the registry key with "Screensaver has been running for x minutes".

This assums the legal notice key gets read each time it is shown - I don't have the spare kit or time to test at the minute, but it should point you in the right direction.

This could be set as a scheduled task to run every minute or two.

It's not exactly clean, but could work.. just about.

Try something like:

strComputer = "."

Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colProcesses = objWMIService.ExecQuery("Select * from Win32_Process")

For Each objProcess in colProcesses
    If Right(objProcess.Name, 4) = ".scr" Then
        Wscript.Echo "Screen saver start time: " & DateDiff("n",WMIDateStringToDate(objProcess.CreationDate),now())
        'Set Registry Key to "x mins"
    End If
Next

Wscript.Echo "The screen saver is not running."
'Set Registry Key to "0 minutes"

Function WMIDateStringToDate(dtmStart)
    WMIDateStringToDate = CDate(Mid(dtmStart, 5, 2) & "/" & Mid(dtmStart, 7, 2) & "/" & Left(dtmStart, 4) & " " & Mid (dtmStart, 9, 2) & ":" & Mid(dtmStart, 11, 2) & ":" & Mid(dtmStart,13, 2))
End Function

Fazer87

Posted 2015-05-22T09:21:38.197

Reputation: 11 177

I'll give this a go and post back - thanks @Fazer87 very good answer – jonboy – 2015-05-22T09:46:04.140