Click here to Skip to main content
15,886,362 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
I need to put my windows 7 in virtual machine into sleep mode, shutdown and wakeup mode using php script.. is there any chances to do this??


Thanks
Siva
Posted
Updated 2-Jan-14 10:31am
v2

1 solution

Use PHP system function...
http://il1.php.net/system[^]

PHP
system('shutdown -t -s 0');
 
Share this answer
 
Comments
sivamzcet 2-Jan-14 12:32pm    
i need to put both shutdown and sleep mode using particular ip.. is there any chances??
Kornfeld Eliyahu Peter 2-Jan-14 12:36pm    
See you options here:
http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/shutdown.mspx?mfr=true
sivamzcet 2-Jan-14 12:53pm    
i need to switch off my virtual machine using php script
Kornfeld Eliyahu Peter 2-Jan-14 13:00pm    
And?
Did you tried shutdown -s -m \\virtual-machine-name -t 0?
sivamzcet 3-Jan-14 1:16am    
i did not tried it yet coz i need to write php script to do diz.. but i have no idea about it.. pls tel me complete php script to do this?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900