Computer Hope

Microsoft => Microsoft DOS => Topic started by: DixiScan on February 03, 2009, 11:30:59 AM

Title: Execute the F5 key with a command in Scheduler
Post by: DixiScan 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
Title: Re: Execute the F5 key with a command in Scheduler
Post by: icepick 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.
Title: Re: Execute the F5 key with a command in Scheduler
Post by: DixiScan 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 ? ???



Title: Re: Execute the F5 key with a command in Scheduler
Post by: Geek-9pm on February 04, 2009, 03:30:26 PM
Quote
Execute the F5 key
You can just do it with a screwdriver...
(http://geek9pm.com/ex-f5.jpg)
Title: Re: Execute the F5 key with a command in Scheduler
Post by: DixiScan 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
Title: Re: Execute the F5 key with a command in Scheduler
Post by: BC_Programmer 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.
Title: Re: Execute the F5 key with a command in Scheduler
Post by: Geek-9pm 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.}
Title: Re: Execute the F5 key with a command in Scheduler
Post by: BC_Programmer on February 05, 2009, 09:27:45 PM
erm- the script was already written by icepick. :)