Jump to content

Set process time


kuhasu
 Share

Recommended Posts

How can I set process time but meanwhile don't change the sys time?

e.gA.exe runs at 2008.01.01

systime is 2006.02.03

TIA

You can create a Loop which contains the a.exe and simply put a call to the loop somewhere in your code and when the dates match then it runs the code.

Not Tested

#Include <date.au3>

Global $DateVariable = yyyy/mm/dd hh:mm:ss ;//Your special time
Global $sEpoch = "2010/01/01 00:00:00"

While 1 
    _RunMyCode($DateVariable)
    Sleep(60000)
    If ProcessExists(a.exe) Exitloop
WEnd

Func _RunMyCode($DateVariable)
      $sNow = _DateDiff('s', $sEpoch, _NowCalc())
    $sRun = _DateDiff('s', $sEpoch, $DateVariable
    If $sNow >= $sRun Then
        A.exe
    EndIf
EndFunc

The above code has not been tested but should give you a starting idea.. Ant..

Link to comment
Share on other sites

I mean to run A.exe at 2008.01.01 where the systime is 2006.02.03

And A.exe calls the value of the systime when it starts.....

some kind of system internal value,it seems...

I am not sure what 2008.01.01 represents yyyy/mm/dd ? or yyyy/dd/mm anyway AutoIT to perform date maths uses the elapsed time value in either days, hours or seconds since a start date

which can be used to set a trigger based on system, or local time. If you investigate AutoIT 'Help' time zone 'Local' and daylight saving off-sets are fully documented as I am not sure what you understand to be the computers system time. Perhaps if you write the code and post it to this forum you will get more specialised support. Many of the examples of date processing in Help

will run so it gives you an opportunity to see what it actually does and provides a good starting point for your solution. Good luck and I look forward to your next post. Ant..

Link to comment
Share on other sites

I am not sure what 2008.01.01 represents yyyy/mm/dd ? or yyyy/dd/mm anyway AutoIT to perform date maths uses the elapsed time value in either days, hours or seconds since a start date

which can be used to set a trigger based on system, or local time. If you investigate AutoIT 'Help' time zone 'Local' and daylight saving off-sets are fully documented as I am not sure what you understand to be the computers system time. Perhaps if you write the code and post it to this forum you will get more specialised support. Many of the examples of date processing in Help

will run so it gives you an opportunity to see what it actually does and provides a good starting point for your solution. Good luck and I look forward to your next post. Ant..

as far as I know,

It seems to change the returned value when a process calling clock() this kind of Vars

Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

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