?
Solved

PHP Page to Shutdown Windows

Posted on 2010-11-24
3
Medium Priority
?
436 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 2000 total points
ID: 34213056
PS you can also use passthru('shutdown -s') and exec('shutdown -s').
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
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…
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.
Suggested Courses

800 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