Solved

Force use to accept computer policy before using computer

Posted on 2012-04-10
2
206 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 47

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

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Developing a front end to SPLUNK 1 57
Tools for analysis of code 4 47
how to read the text file and convert it to csv. 5 36
C# Windows Form Navigation - Total Beginner 9 42
Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.

749 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