RSS

Getting input from command prompt from VBScript

28 Jun

Was looking around the net to find out how I can get input from users via the command prompt in a VBScript. Most of the examples giving are for the inputbox, which uses the Windows dialog. After a few refinements, I finally found what I wanted:

http://www.mhuffman.com/notes/language/vbs_intro.htm#INPUT

input2.vbs

Option Explicit

Dim name

Wscript.StdOut.Write “Enter your name: ” ‘prompt user for input
name = Wscript.StdIn.ReadLine ‘get user’s name

Wscript.Echo “Hello, ” & name & ” , welcome to CIS 121!”
‘ could also use Wscript.StdOut.WriteLine

Advertisements
 
2 Comments

Posted by on June 28, 2006 in Scripts, VBScripts

 

Tags:

2 responses to “Getting input from command prompt from VBScript

  1. Akshat

    December 14, 2006 at 11:02 am

    That was sure a great help!

    It was listed 7th in my search results

     
  2. saltwetfish

    December 15, 2006 at 12:57 am

    Glad that its been helpful for you

     

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: