Task scheduler to detect time zone change or set to run when app run


  1. Posts : 70
    Windows 7 ultimate 64bit
       #1

    Task scheduler to detect time zone change or set to run when app run


    Hi,

    I want to know if it's possible to get the task scheduler to run when an app runs. So far I haven't found a way to do it.

    Although I'd like to know how to do this anyway the pressing concern is that one of my apps is changing the time zone everytime I run it.

    I have a powershell script which checks that my time zone is correct and if not resets it. But the trigger is the problem. I don't know how to get the trigger to recognise this change and would like some advise as to how I can detect the change (what event am I looking for?)

    Alternatively as mentioned above how can I detect the application running and change it. The event 'application' doesn't seem to do it and has only a select bunch of choices non of which seem appropriate.

    Maybe what I am trying to do is not possible?
      My Computer


  2. Posts : 6,285
    Windows 10 Pro X64
       #2

    By app, do you mean program or app like in Win 8 or 10?

    If program, why not look for another that doesn't change the time zone, or maybe there is an option or parameter for the program that can help?

    Alternatively you could launch the app via a batch file and as soon as it launched then launch your powershell script. Set the script to loop until the app terminates then fix the time zone and exit.
      My Computer


  3. Posts : 70
    Windows 7 ultimate 64bit
    Thread Starter
       #3

    Sorry I meant program not app.

    Thanks for the suggestions. I like the batch file idea although I'm a little wary of the script looping taking up resources. Not really that adept with powershell but I'll figure it out.
      My Computer


  4. Posts : 10,485
    W7 Pro SP1 64bit
       #4

    You only need a loop if the program changes the Time Zone over and over while it runs.

    If your program only changes the Time Zone once, then your batch file could look like:

    program
    timeout 10
    powershell script
      My Computer


  5. Posts : 70
    Windows 7 ultimate 64bit
    Thread Starter
       #5

    It does so it needs a way to detect when the program terminates then set it back.
    Is there a way to get that info when it stops running?
      My Computer


  6. Posts : 7,107
    W7 home premium 32bit/W7HP 64bit/w10 tp insider ring
       #6

    task scheduler


    Has the program, (it would be handy to know what it is), created its own task.
    You can check via
    Controlpanel>admintools>taskScheduler>taskscheduler library,
    this lists all non MS tasks.
    If its there highlight it and delete.

    Alternately create a basic task to run the Windows time service after the program has started.
    Same route as above.

    Roy
    Attached Thumbnails Attached Thumbnails Task scheduler to detect time zone change or set to run when app run-task-sched.png  
      My Computer


  7. Posts : 6,285
    Windows 10 Pro X64
       #7

    I'm sure Powershell has a way to query a task. How often it has to wake up to query the task then reset the time depends on your usage of the program.

    What program by the way?
      My Computer


  8. Posts : 70
    Windows 7 ultimate 64bit
    Thread Starter
       #8

    The program is Metal Gear. I have no idea why it does this.
      My Computer


  9. Posts : 6,285
    Windows 10 Pro X64
       #9

    Nothing returned on a search for metal gear changes data on system
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 13:02.
Find Us