Solved

PHP Page to Shutdown Windows

Posted on 2010-11-24
3
428 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

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
.htaccess 5 39
How would I do a website like this? 5 60
Using javascript confirmation for a delete in mysql 5 34
What does this formatting equate to? 7 12
This article will explain how to display the first page of your Microsoft Word documents (e.g. .doc, .docx, etc...) as images in a web page programatically. I have scoured the web on a way to do this unsuccessfully. The goal is to produce something …
3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

832 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