Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

PHP Page to Shutdown Windows

Posted on 2010-11-24
3
Medium Priority
?
437 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

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this. Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it i…
There are times when I have encountered the need to decompress a response from a PHP request. This is how it's done, but you must have control of the request and you can set the Accept-Encoding header.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
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

610 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