InputBox


Definition: Displays a prompt in a dialog box, waits for the user to input text or click a button, and returns the contents of the text box.

 

OK, this was a tough one. At first we figured that the easiest way to create an input box would be to rely on the .NET Framework and Visual Basic .NET. That worked, but with one major problem: the input box always appeared behind all the other windows on the desktop. That meant that the input box would appear, but no one would ever see it. Not exactly what we were hoping for.

 

At our wit’s end, we did what anyone else would do in our situation: we started searching the Internet looking for sample code we could steal. And, sure enough, we found some, courtesy of /\/\o\/\/, a Windows PowerShell MVP. (Check out his Web site and blog ; when it comes to Windows PowerShell, this guy knows what he’s talking about.) Here’s the solution /\/\o\/\/ came up with:

 

$a = new-object - comobject MSScriptControl.ScriptControl
$ a.language= " vbscript"
$ a.addcode ("function getInput() getInput= inputbox(`"Message box prompt`",`"MessageBox Title`") end function" )
$b = $ a.eval(" getInput")

 

We won’t bother trying to explain how this works; we’ll simply note that it doeswork. We’ll also point out that you have to type this exactly as shown; in particular, that means including all the little backticks(the ` character) when assigning a message box prompt and title.

 

By the way: thanks, /\/\o\/\/!

 

 

 

500 Internal Server Error

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at webmaster@systemmanager.forsenergy.ru to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.

Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.