Question Locked

Logon Script

0 helpful
2 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
I want a script that appears when the user logs on that states a warning message and the user will have to click yes to get onto the desktop or if they click no it will log them out.

2 replies

by dan.cox

You may need to modify it for exactly what you want to do and what message you want to display.

strSPMethod = MsgBox("Click Yes if you want to log in. Click No to log out:",260,"Login Script Message Box:")
If strSPMethod = 6 Then
WScript.Echo "Ok, you are now into the network!"

Else
WScript.Echo "You are now being logged out."
Set WshShell=WScript.CreateObject("WScript.Shell")
WshShell.run "shutdown.exe -R -F"

End If

This discussion is closed to new replies.