| View previous topic :: View next topic |
| Author |
Message |
habs42 Guest
|
Posted: Wed Jul 02, 2008 9:14 pm Post subject: how do I make it Shut down computer at 12 pm |
|
|
my script is :
| Code: | Loop
{
FormatTime, TimeString
MsgBox The current time and date (time first) is %TimeString%
FormatTime, TimeString, T12, Time
MsgBox The current 24-hour time is %TimeString%
If TimeString =
MsgBox The computer will reboot now
Else
MsgBox The computer will stay on
} |
What do I put after TimeString= I tried everything
thanks in advance for your help |
|
| Back to top |
|
 |
BoBo² Guest
|
Posted: Wed Jul 02, 2008 9:43 pm Post subject: |
|
|
SetFormat, Check, 60*1000*60
If/Else
A_Hour
Return |
|
| Back to top |
|
 |
SKAN
Joined: 26 Dec 2005 Posts: 6084
|
Posted: Wed Jul 02, 2008 10:22 pm Post subject: |
|
|
| Code: | Loop
If ( SubStr( A_Now DllCall( "Sleep", UInt,1000 ),9,4 ) >= "1200" )
ShutDown, 8 |
 _________________
 |
|
| Back to top |
|
 |
[VxE]
Joined: 07 Oct 2006 Posts: 1233
|
Posted: Thu Jul 03, 2008 12:39 am Post subject: |
|
|
(fyi: 12pm == noon)
If you mean midnight, replace >= "1200" with <= 1 in the code SKAN posted. _________________ My Home Thread [New: Vector Function Library]
More Common Answers: 1. It's in the FAQ 2. Ternary ( ? : ) guide 3. Post code with [code][/code] tags |
|
| Back to top |
|
 |
habs42 Guest
|
Posted: Thu Jul 03, 2008 2:09 pm Post subject: |
|
|
I meant noon and I want to put this script on start up so everyday at noon the pc will restart on its own
I have to replace SKAN's shutdown, 8 with shutdown, 6
thanks for your help guys |
|
| Back to top |
|
 |
habs42 Guest
|
Posted: Thu Jul 03, 2008 2:20 pm Post subject: |
|
|
will this work on any computer? and will the time zones mess with the time?
Like if I put this on a pc in Europe and I'm in North America will it shut down at their noon or our noon? |
|
| Back to top |
|
 |
SKAN
Joined: 26 Dec 2005 Posts: 6084
|
Posted: Thu Jul 03, 2008 2:27 pm Post subject: |
|
|
@habs42
| Quote: | | will this work on any computer? |
Only Windows PC
| Quote: | | and will the time zones mess with the time? |
No
| Quote: | | Like if I put this on a pc in Europe and I'm in North America will it shut down at their noon or our noon? |
It will use the local system time ( Shown on TNA ) of the machine it is running on.
 _________________
 |
|
| Back to top |
|
 |
habs42
Joined: 03 Jul 2008 Posts: 19
|
Posted: Fri Jul 04, 2008 6:25 pm Post subject: |
|
|
SKAN,
If I want to change the time to 15 minutes ahead
in this script :
| Code: | #SingleInstance, ignore
#NoTrayIcon
Loop
{
If ( SubStr( A_Now DllCall( "Sleep", UInt,1000 ),9,4 ) = "1200" )
ShutDown, 6
}
|
instead of ="1200" would it be ="1215"
and If I want to change it to 15 minutes behind it would be ="1145" ? |
|
| Back to top |
|
 |
Razlin
Joined: 05 Nov 2007 Posts: 417 Location: canada
|
Posted: Fri Jul 04, 2008 6:30 pm Post subject: |
|
|
yes thats correct _________________ -=Raz=- |
|
| Back to top |
|
 |
|