Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8332409
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T02:42:54+00:00 2026-06-09T02:42:54+00:00

In vbscript it is common to use the browser (IE) as a GUI. See

  • 0

In vbscript it is common to use the browser (IE) as a GUI.
See the example below, it asks for a name and returns it to the script. In Ruby you have a few GUI’s like Tcl and Shoes but i wonder how to do this in the browser. What is the simplest Ruby solution to do this ? So no exta gems or packages, no server that is allready running.. If a gem is needed, preferably one that works in Windows without problems.

Here the vbscript sample

Set web = CreateObject("InternetExplorer.Application")
If web Is Nothing Then
  msgbox("Error while loading Internet Explorer")
  Wscript.Quit
Else
  with web
    .Width = 300
    .Height = 175
    .Offline = True
    .AddressBar = False
    .MenuBar = False
    .StatusBar = False
    .Silent = True
    .ToolBar = False
    .Navigate "about:blank"
    .Visible = True
  end with
End If

'Wait for the browser to navigate to nowhere
Do While web.Busy
  Wscript.Sleep 100
Loop

'Wait for a good reference to the browser document
Set doc = Nothing
Do Until Not doc Is Nothing
  Wscript.Sleep 100
  Set doc = web.Document
Loop

'Write the HTML form
doc.Write "Give me a name<br><form><input type=text name=name ><input type=button name=submit id=submit value='OK' onclick='javascript:submit.value=""Done""'></form>"
Set oDoc = web.Document
Do Until oDoc.Forms(0).elements("submit").Value <> "OK"
  Wscript.Sleep 100
  If web Is Nothing or Err.Number <> 0 Then
    msgbox "Window closed"
    Wscript.Quit
  End If
Loop
name = oDoc.Forms(0).elements("name").value
oDoc.close
set oDoc = nothing
web.quit
set web = nothing
Wscript.echo "Hello " & name
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T02:42:56+00:00Added an answer on June 9, 2026 at 2:42 am

    You could use the Watir gem. The gem was originally intended to drive the IE browser, but would fit your need.

    To see:

    1) Install the Watir gem

    2) Create a test.htm file with the following:

    Give me a name<br>
    <form name="myForm" title="myForm">
        <input type="text" id="name" >
        <input id="submit" type="button" value="OK" onclick='document.myForm.submit.value="Done"'>
    </form>
    

    3) Run the following watir script, which will open the browser to your form. After you input the name and click [OK], the name is outputted. Note that you may need to change the location of the file in the script depending on where you saved your test.htm:

    require 'watir'
    
    b = Watir::IE.new
    begin
        b.goto('file:///C:/Documents%20and%20Settings/Setup/Desktop/test.htm')
        begin
            sleep(5)
        end until b.button(:id, 'submit').value != "OK"
        name = b.text_field.value
    ensure
        b.close
    end
    puts name
    

    I think this shows the general feasibility of doing what you want. Validation and dynamic creation of the forms would also be possible.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a VBScript which pulls the service tag, username, and computer name
Ok I have a vbscript string in a wsf file as below: Dim strTransData
I have a VBScript script that runs a second VBScript script. The second VBScript
VBScript doesn't appear to have a way to include a common file of functions.
We have an old process (VBScript) that reads a common mailbox and processes certain
I don't have any experience programming with VBScript and I'd like to use some
Since VBScript doesn't support lookbehinds, I'm looking for an alternative solution. I have the
I have a vbscript file that I want to run in my vb.net application.
I have a VBScript COM Component where I'm using Msxml2.FreeThreadedDOMDocument.4.0 however is there /
In VBScript, some built in objects use an unnamed property. Some Examples: Set Dict

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.