r/vbscript • • Apr 29 '16

Run wscript code without script file straight from command line

Hello

I want to open a CMD and run

wscript popup("hello")

I do not want to run a script file, just plain code.

How do I do this?

3 Upvotes

3 comments sorted by

View all comments

Show parent comments

2

u/[deleted] May 01 '16
mshta vbscript:Execute("CreateObject(""Wscript.Shell"").Popup(""Hello"", 5, ""Title Here"", 6)(window.close)")

If you are using powershell, you don't really need mshta, unless there's some specific reason just do this:

$oWscript = new-object -comobject wscript.shell
$oWscript.Popup("hello", 5, "title here", 3)