Solved

PHP Page to Shutdown Windows

Posted on 2010-11-24
3
426 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
Comment Utility
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
Comment Utility
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
Comment Utility
PS you can also use passthru('shutdown -s') and exec('shutdown -s').
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Suggested Solutions

I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

763 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

11 Experts available now in Live!

Get 1:1 Help Now