Solved

Force use to accept computer policy before using computer

Posted on 2012-04-10
2
202 Views
Last Modified: 2012-05-07
Trying to write a computer usage policy in vbscript whereby a user would have to click yes to accept before using the computer.  Trying to lock the computer until the message is responded to.  VBSYSTEMMODAL is not working and I cannot just exit out of the IF statement if they click yes.   Here is my code so far:

wscript.echo("Internet Use Disclaimer: The Library is responsible only for those pages bearing the name. The Internet is a global collection of computer networks that connects thousands of computers worldwide some of which may contain controversial or offensive material. The Internet contains many valuable sources of information, but not all sites are accurate, complete, or up-to-date, and there are sites which some users may consider controversial, offensive or inappropriate. The library does not monitor and has no control over the information accessed through the Internet and cannot be held responsible for its content.")  
      answer = msgbox("Please select yes to accept",vbyesno + vbsystemmodal,"Internet Disclaimer")
      
          
If Answer = vbYes Then
        Exit 0
    Else
        Set oWS = CreateObject("WScript.Shell")
        oWS.Run "shutdown -L -F"
   
End If
0
Comment
Question by:Webcc
2 Comments
 
LVL 45

Accepted Solution

by:
Martin Liss earned 250 total points
ID: 37830679
Try

If vbNo = msgbox("Please select yes to accept",vbyesno + vbsystemmodal,"Internet Disclaimer") Then

        Set oWS = CreateObject("WScript.Shell")
        oWS.Run "shutdown -L -F"
   
End If
0
 
LVL 65

Assisted Solution

by:RobSampson
RobSampson earned 250 total points
ID: 37831054
Hi, there's a couple of options here, although not fully fleshed out.
http://www.experts-exchange.com/Microsoft/Applications/Q_26983378.html

Regards,

Rob.
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Suggested Solutions

Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now