|
Prev: VWD 2005 Express ?
Next: DPM pre/post script
From: Tony Bansten on 20 Jun 2008 11:59 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? Tony
From: Richard Mueller [MVP] on 20 Jun 2008 12:25 Tony wrote: > 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? > You can use the MsgBox function to display anything. You can concatenate the 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 --
From: kimiraikkonen on 20 Jun 2008 18:21 On Jun 20, 6:59 pm, tonyt...(a)hotmail.com (Tony Bansten) wrote: > 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? > > Tony Hi, I might not understand your issue well however, do you want to use a kind of class like Input Box to get and evaluate values from user? Dim value As String value = InputBox("Ask sth", "prompt") ' Show in MsgBox Msgbox(value) HTH, Onur
|
Pages: 1 Prev: VWD 2005 Express ? Next: DPM pre/post script |