Page 1 of 1

Shutdown help?

Posted: Wed Aug 08, 2012 9:38 pm
by CodenBoy
Hi Guys,

If i want to shutdown i use
Code: Select all
Shell("shutdown -s")
but i forgot the code to make it timed, like if i want it after 1 minute ( 60seconds )
Code: Select all
Shell("shutdown -s time:60")
' but it didnt work? any other codes? i dont know if this is right but ? any ideas?

Thanks

Re: Shutdown help?

Posted: Wed Aug 08, 2012 9:49 pm
by codedrive
Get a timer and set it on enabled and add this code and add 1 label and make it say the text 0
Code: Select all
Label1.text=label1.text + 1
If Label1.text="60" then
Shell("shutdown -s")

Re: Shutdown help?

Posted: Wed Aug 08, 2012 9:49 pm
by muttley1968
isn't it just -t 60

Re: Shutdown help?

Posted: Wed Aug 08, 2012 10:12 pm
by CodenBoy
#codedrive , i cant use ur code since i need it on many durations,
#muttley1968 im leaving home now when im back i will check,
#people u can post more codes if u wanna :D

Re: Shutdown help?

Posted: Thu Aug 09, 2012 1:06 am
by CodenBoy
Thanks #muttley1968 worked great, but now instead of new topic shutdown -s for shutdown, -r for restart -l for logoff what is for the "sleep"?
thanks

Re: Shutdown help?

Posted: Thu Aug 09, 2012 2:35 am
by muttley1968
As far as I am aware there is not one for sleep

Re: Shutdown help?

Posted: Thu Aug 09, 2012 2:57 am
by CodenBoy
Okay, thanks anyway maybe someone else knows it XD?
(Sleep time!)

Re: Shutdown help?

Posted: Thu Aug 09, 2012 6:56 am
by AnoPem
For sleep mode use this
Code: Select all
Shell("cmd /c rundll32.exe powrprof.dll,SetSuspendState 0,1,0")

Re: Shutdown help?

Posted: Thu Aug 09, 2012 12:44 pm
by CodenBoy
#AnoPem , thank you ,