Jump to content

Recommended Posts

Posted

Designed to run a "task" and time/day settings from an ini file but you can modify it..

$g_szVersion = "QShed"
If WinExists($g_szVersion) Then Exit; It's already running
AutoItWinSetTitle($g_szVersion)

Opt("TrayAutoPause",0)
Opt("TrayMenuMode",1)

$days = IniRead ("Qshed.ini" , "General" , "Days", "Sun")
$ShedTime = Number (IniRead ("Qshed.ini" , "General" , "Time", "0300"))

Local $aDayOfWeek[8]
    
    $aDayOfWeek[1] = "Sun"
    $aDayOfWeek[2] = "Mon"
    $aDayOfWeek[3] = "Tue"
    $aDayOfWeek[4] = "Wed"
    $aDayOfWeek[5] = "Thu"
    $aDayOfWeek[6] = "Fri"
    $aDayOfWeek[7] = "Sat"

$aDays = Stringsplit ($Days, ",")
While 1
    $CurrentTime = Number (@Hour & @Min)
    For $i = 1 to Ubound ($aDays) -1

     If $aDays[$i] =  $aDayOfWeek[@WDAY] Then
        If Number ($CurrentTime) = Number ($ShedTime) Then
        MsgBox  (0,"Run","Run the scheduled task here but sleep for 1 minute after run to avoid running twice")
        Sleep (60000)
        EndIf
     Endif
     Sleep (1000)
     Next
Wend
  • Moderators
Posted

Would it be able to do Shutdown ( 1 + 4 + 8) ?

I'm not sure what the power down option is for, but it will turn the computer off if that is what you are asking.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...