User Tag List

Results 1 to 2 of 2

Thread: Anyone knows how to.....

  1. #1
    Anyone knows how to.....

    User Info Menu

    Anyone knows how to.....

    Hey! i know that VBS is a dead language by now, but anyone happens to know how to open a Y/N msgbox? Kind of like "Click YES to continue or Click NO to no-continue" I´m working on a really cool thing i´ll share with you guys once im done.... im only missing the last piece of the puzzle.
    My favorite food is 3.14 :P

  2. #2
    Anyone knows how to.....

    User Info Menu

    Re: Anyone knows how to.....

    Got this off some pro site.

    You can use the Msgbox function to display a Yes/No dialog box, as the following example shows:

    Ret=Msgbox("Are you sure you want to reboot?",VBYesNo,"Reboot Confirm")

    Ret is variable that contains the Msgbox return code, which varies depending on the button the user pressed (Yes returns a value of 6; No returns a value of 7). The parentheses contain the question text; the VBYesNo constant, which tells VBScript to display Yes and No buttons; and the dialog box title. The figure at Figure shows the Yes/No box that the code example produces.

    The following code shows how to use the Msgbox function in a script:

    Ret=Msgbox_
    ("Are you sure you want to reboot?",VBYesNo,"Reboot confirm")
    If Ret=6 then
    Set OpSysSet =
    GetObject("winmgmts:{(Shutdown)}//./root/cimv2").ExecQuery_
    ("select * from Win32_OperatingSystem where Primary=true")

    for each OpSys in OpSysSet
    OpSys.Reboot()
    next
    end if
    ||||| RETIRED |||||
    xxxxxxxxxxxxxxxxxxx
    Before asking a question try searching for it.
    Links: Forum Rules, Forum Updates, Buy VIP/Premium, My Webdesign Site, Contact Me

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •