Solved

Force use to accept computer policy before using computer

Posted on 2012-04-10
2
204 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 46

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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A short article about problems I had with the new location API and permissions in Marshmallow
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
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…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

785 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