Solved

PHP Page to Shutdown Windows

Posted on 2010-11-24
3
427 Views
Last Modified: 2012-05-10
Hi, can someone tell me if I can use a PHP web page to run a standard shutdown command on a windows server.  If so how ?
0
Comment
Question by:frontpedal
  • 2
3 Comments
 
LVL 4

Expert Comment

by:Fugas
ID: 34204625
http://php.net/manual/en/function.exec.php , but the user running IIS on server should have right to execute the shutdown command and in php.ini must be the EXEC function allowed
0
 
LVL 1

Expert Comment

by:huangzhtao
ID: 34212965
You can try the code below.
I tested it on my WampServer, it works.

<?php

$cmd3 = 'shutdown -s';

system($cmd3);

?>

Open in new window

0
 
LVL 1

Accepted Solution

by:
huangzhtao earned 500 total points
ID: 34213056
PS you can also use passthru('shutdown -s') and exec('shutdown -s').
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Generating table dynamically is the most common issue faced by php developers.... So it seems there is a need of an article that explains the basic concept of generating tables dynamically. It just requires a basic knowledge of html and little maths…
Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
The viewer will learn how to dynamically set the form action using jQuery.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now