Below is part of a script that I am trying to deploy via SCCM Software Distribution. The script notifies the user that they need to restart their machine. If the user opens another window, hiding the notification, the notification is supposed to reappear in front of all other windows every 10 minutes. This function works properly when testing on my machine.
When running the script from a remote system, the timeout feature does not work. It also doesn’t work if I copy the file to another machine and run. Can someone tell me how to edit the script so the timeout method works when running remotely?
[CODE]<script language=”JavaScript”>
var timeoutId;
function setReminder() {
timeoutId = window.setTimeout(“window.focus()”, 10*60*1000);
}
function cancelReminder() {
if (timeoutId>0) {
window.clearTimeout(timeoutId);
}
}
// set the window to come back in focus
window.onblur = setReminder;
// reset the timeout if the window comes back in focus
window.onfocus = cancelReminder;
</script>
Thank you!