Show shell command output from Jscript

I want to run a shell command from jscript from IE on a Windows machine.

I have the following jscript function:

function execCommand( command ){
    var myShell =  new ActiveXObject("WScript.Shell");
    myShell.Exec( "cmd /c " + command );
}

On Windows, a new query window opens, the command runs, and the window closes. However, the prompt never shows any output from the command. While the command is running, an empty prompt window appears.

How can I make the output of a program display prompts in a window?

I was looking for other questions, but I found solutions for scripts running inside the Windows Scripting Host, or for javascript javascript jscript running in Mozilla.

I appreciate any tips.

+3
source share
1 answer

.

exec stdout , , cmd % comspec% /K, .

, , ...

0

All Articles