#1 18 May 2013 22:31

0blockie
New Member
From: California, USA
Registered: 18 May 2013
Posts: 2

I need help with this vbs file

I am writing a batch file to go into a scheduled task in Windows 7. The complete project will automatically logoff a user after a period of inactivity.
A  warning message will be displayed warning the user of the impending logoff, giving him/her a chance to continue staying in the user account. If the user has abandoned the computer leaving his/her account open ,the account will be closed after 60 seconds of the start of the warning message.
What I have so far follows:

LOGOFF.VBS

x=msgbox("There have been 15 minutes or more of inactivity on this computer. Automatic  LOGOFF will occur in 60 seconds." ,292, "LOGOFF")
IF x=6 THEN
QUIT
ELSE
RUN SHUTDOWN /L
END IF

Offline

#2 19 May 2013 22:25

0blockie
New Member
From: California, USA
Registered: 18 May 2013
Posts: 2

Re: I need help with this vbs file

In the meantime I continued to look for a ready made answer to my cry for help.



A free screen saver that logs off a user account after a period of inactivity. Problem solved.

Offline

#3 20 May 2013 07:40

npocmaka
Member
From: Bulgaria
Registered: 03 Dec 2009
Posts: 422

Re: I need help with this vbs file

x=msgbox("There have been 15 minutes or more of inactivity on this computer. Automatic  LOGOFF will occur in 60 seconds." ,292, "LOGOFF")
IF x=6 THEN 
	WScript.Quit
ELSE
	set objShell = WScript.CreateObject("WScript.Shell")
	Return = objShell.Run("SHUTDOWN.exe /L " & WScript.ScriptFullName, 1, true)
END IF

Offline

Board footer

Powered by FluxBB