wwfc_barmy_army Posted October 27, 2008 Share Posted October 27, 2008 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. Quote Link to comment Share on other sites More sharing options...
trq Posted October 27, 2008 Share Posted October 27, 2008 Have you looked at the exec familly of functions? I'm not sure you need to go down the com route. Quote Link to comment Share on other sites More sharing options...
wwfc_barmy_army Posted October 30, 2008 Author Share Posted October 30, 2008 Hello. Sorry about the late reply. Yes, i tried the exec command yesterday but it doesn't appear to do anything, the php script just continues to try and load and the command line doesn't appear to run either. Any ideas? Thanks., Quote Link to comment Share on other sites More sharing options...
wwfc_barmy_army Posted October 30, 2008 Author Share Posted October 30, 2008 In addition i have looked at a process monitor and found these results: It appears to show that it's run it, but it hasn't. Any ideas? Thanks. Quote Link to comment Share on other sites More sharing options...
wwfc_barmy_army Posted October 30, 2008 Author Share Posted October 30, 2008 Also, i've noticed that it closed cmd very quickly after the command was run, perhaps not being it enough time to run. Any suggests? Thanks. Quote Link to comment Share on other sites More sharing options...
wwfc_barmy_army Posted October 31, 2008 Author Share Posted October 31, 2008 Anyone? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.