Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Execute the F5 key with a command in Scheduler  (Read 22566 times)

0 Members and 1 Guest are viewing this topic.

DixiScan

    Topic Starter


    Starter

    Execute the F5 key with a command in Scheduler
    « on: February 03, 2009, 11:30:59 AM »
    Hi all,

    My Windows Scheduler has to start some software on my computer, by clicking the Start button.
    This Start button is also assigned to the function key F5.
    I know how to work with the Scheduler, but is it possible to define a script/command to execute this "F5 press"?

    Please help!

    Vince

    icepick

    • Guest
    Re: Execute the F5 key with a command in Scheduler
    « Reply #1 on: February 03, 2009, 12:57:20 PM »
    It depends on what you are trying to do.  Do you have more information about the task?

    I don't know of a way to do it with at pure batch file, but if you can use vbscript or wsh to execute your tasks, you can use this code:

    Code: [Select]
    Set objShell = CreateObject("WScript.Shell")
    objShell.SendKeys "{F5}"

    Just copy this to a file, and rename it to f5key.vbs.  When you run it, it will simulate a keyboard press of the F5 key.

    DixiScan

      Topic Starter


      Starter

      Re: Execute the F5 key with a command in Scheduler
      « Reply #2 on: February 04, 2009, 03:00:19 PM »
      Hi, thanks for the answer, but I'm sorry, I can't use vbscript... :-[

      The situation is this:
      I'm using some software for a measuring equipment on a laboratory.
      The equipment is very sensitive for vibrations, so I want to start this device at night, when the cleaners are outside this laboratory...
      The fist thought was using Windows Scheduler to give the software a 'cue' to begin the experiment at a certain time, let say 2am.
      So, the software is already started up and waiting for this cue to begin.
      This can be done with pressing the 'start button' but also with the F5 key on the keyboard.  :)

      So, now I'm looking for a method to let give Scheduler this F5 command.

      Maybe this can be done with a small batch file, that will be executed by the Scheduler at 2am ? ???




      Geek-9pm


        Mastermind
      • Geek After Dark
      • Thanked: 1026
        • Gekk9pm bnlog
      • Certifications: List
      • Computer: Specs
      • Experience: Expert
      • OS: Windows 10
      Re: Execute the F5 key with a command in Scheduler
      « Reply #3 on: February 04, 2009, 03:30:26 PM »
      Quote
      Execute the F5 key
      You can just do it with a screwdriver...

      DixiScan

        Topic Starter


        Starter

        Re: Execute the F5 key with a command in Scheduler
        « Reply #4 on: February 05, 2009, 10:09:03 AM »
        Hi !
        Thats great !! Thanks Geek-9pm   :D
        Is this a normal screwdriver? Or Torx or Philips?
        Please give me the color of the shaft, so I can buy the same as you have.
        There is one problem: I'm lefthanded, so my F5 key can flip over to the right instead of left.
        Hope this will not be a big problem...
        Thanks again, and maybe till next time.

        Dixi

        BC_Programmer


          Mastermind
        • Typing is no substitute for thinking.
        • Thanked: 1140
          • Yes
          • Yes
          • BC-Programming.com
        • Certifications: List
        • Computer: Specs
        • Experience: Beginner
        • OS: Windows 11
        Re: Execute the F5 key with a command in Scheduler
        « Reply #5 on: February 05, 2009, 10:12:07 AM »
        Anyway- why can't you use VBScript? you could use the scheduler to schedule the script to run, and then it would "press f5" for you.
        I was trying to dereference Null Pointers before it was cool.

        Geek-9pm


          Mastermind
        • Geek After Dark
        • Thanked: 1026
          • Gekk9pm bnlog
        • Certifications: List
        • Computer: Specs
        • Experience: Expert
        • OS: Windows 10
        Re: Execute the F5 key with a command in Scheduler
        « Reply #6 on: February 05, 2009, 01:30:38 PM »
        Quote
        Anyway- why can't you use VBScript?

        {Whisper: Just act dumb and
        BC will do the script for you.}

        BC_Programmer


          Mastermind
        • Typing is no substitute for thinking.
        • Thanked: 1140
          • Yes
          • Yes
          • BC-Programming.com
        • Certifications: List
        • Computer: Specs
        • Experience: Beginner
        • OS: Windows 11
        Re: Execute the F5 key with a command in Scheduler
        « Reply #7 on: February 05, 2009, 09:27:45 PM »
        erm- the script was already written by icepick. :)
        I was trying to dereference Null Pointers before it was cool.