Jump to content

Running script on command line


wwfc_barmy_army

Recommended Posts

Hello.

 

I'm trying to use PHP to run a scipt on the webserver, i've tried using this:

 

<?php
$runCommand = 'C:\psshutdown.exe \\B17-01 -u administrator -p xp2005 -t 60 -f -k -m "This PC Will Blow Up In 60 Seconds!  Run You Fool!?"'; 

//Wrong by purpuse to get some good output

$WshShell = new COM("WScript.Shell");

$output = $WshShell->Exec($runCommand)->StdOut->ReadAll;

echo "<p>$output</p>";
?> 

 

But it just keeps thinking about it and never runs it. Works if i do the command manually. Any suggestions?

 

Thanks.

Link to comment
https://forums.phpfreaks.com/topic/130282-running-script-on-command-line/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.