-1

Im trying to figure out if we can execute a WMIC from html or javascript.

wmic code : wmic /node:"server" /output:"C:test2.html" SERVICE where (state=”running”) get Name, Caption, State, ServiceType, StartMode, pathname /FORMAT:"htable.xsl"

html code :

<html>
    <head>
       <script language="JScript">
        Function cmds1()
        {
            var run=new ActiveXObject('WSCRIPT.Shell').Run("commands to run");

            objShell.ShellExecute("cmd.exe", "", "", "open", 2);
        }
    </script>
        <form name="input" action="test.asp" method="get">Server name <input type="text" name="Server">
    <input id="E1" type="button" value="submit" onClick="cmds1()">
    </form>
Pravin
  • 1
  • 2

1 Answers1

0

I think (and hope) that you can't do that on the clients machine. You can take a look here for some general information about calling exes: What are some methods to link to and run a local .exe file in a local browser

Community
  • 1
  • 1
Christine
  • 125
  • 8