Displaying a message in VBScript
-
Hi guys, Anyone know how to display a message in a .vbs? I want to run a script and display a message to the user depending on the outcome of the script. Set objWshNetwork = CreateObject("WScript.Network") strComputer = "k1hq1oa0004a" Usuario="administrator" Set objUser = GetObject("WinNT://" & strComputer & "/" & Usuario & ",user") objUser.SetPassword "123456789" objUser.SetInfo ''Code to display message here :rose::rose: 1fm1fu -- modified at 4:51 Thursday 6th April, 2006
-
Hi guys, Anyone know how to display a message in a .vbs? I want to run a script and display a message to the user depending on the outcome of the script. Set objWshNetwork = CreateObject("WScript.Network") strComputer = "k1hq1oa0004a" Usuario="administrator" Set objUser = GetObject("WinNT://" & strComputer & "/" & Usuario & ",user") objUser.SetPassword "123456789" objUser.SetInfo ''Code to display message here :rose::rose: 1fm1fu -- modified at 4:51 Thursday 6th April, 2006
There's a couple of ways of doing this. You can use
Wscript.Echo "message"
, where each call to Echo will generate a new message box with just an OK button. You can callMsgBox
(documentation[^]), where you'll have the ability to specify which buttons will show up and also get a return value for which button was clicked. Dave Kreskowiak Microsoft MVP - Visual Basic