Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

There's any way to run vbscript directly to wscript or cscript command line

I want to run a vbs command from command line as I would in batch calling

cmd.exe /c "echo.Hello World! & pause"

Obviously this doesn't work

wscript /C MsgBox("Hello world")

I could print the vbs and then call the temporary file and then delete it

cmd.exe /c "echo. [VBSCODE] > temp.vbs & wscript temp.vbs & del temp.vbs"

but this is too messy, and I don't want the prompt poping up.

like image 407
Vitim.us Avatar asked Oct 29 '12 03:10

Vitim.us


1 Answers

This works directly on the command line:

mshta vbscript:Execute("MsgBox(""Message"",64,""Title"")(window.close)")

also for several commands:

mshta vbscript:Execute("MsgBox ""Message"",64,""Title"":MsgBox ""Hello again!"",64,""Hello"":close")
like image 133
tinyfiledialogs Avatar answered Sep 28 '22 07:09

tinyfiledialogs