![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Re: How to display a variable value in a dialog box and how to read user input? Tony wrote: Quote: > Sorry for this newbie question, but how do I display a variable value from > a *.vbs script > in a dialog box and - secondly - how to read a user input from a dialog > entry field > into a *.vbs script variable? > value of a variable into a string to display. For example: ==== strValue = "Error" strMessage = "Value of variable strValue: " & strValue & "." Call MsgBox(strMessage, vbOKOnly + vbInformation, "My Script Title") ========= Look up the MsgBox function in vbscript help. I run most scripts at a command prompt using cscript. The MsgBox function pops up a box with the message, but you can also echo to the command line with Wscript.Echo statements. For example: ======== strValue = "Error" strMessage = "Value of variable strValue: " & strValue & "." Wscript.Echo strMessage ======= To get input from the user, use the InputBox function. For example: ===== strValue = InputBox("Enter a value", "My Script Title") Wscript.Echo "The user entered the value: " & strValue ======== Again, check the help files for more syntax help, or search on "MsgBox" and "InputBox". -- Richard Mueller MVP Directory Services Hilltop Lab - http://www.rlmueller.net -- |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| read strings to variable | VB Script | |||
| How to read a user input value from command line and store it in a variable? | VB Script | |||
| Re: How to display a variable value in a dialog box and how to readuser input? | VB Script | |||
| Missing manual recipient input fields in send dialog? | Vista print fax & scan | |||
| Read-Host issue, won't store to variable when using multiple read-host lines | PowerShell | |||