Home | Blog | Software | Reviews and Features | Forum | Help | Donate | About us
topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • August 31, 2015, 12:46:52 PM
  • Proudly celebrating 10 years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Last post Author Topic: Simple Commandline to send Keystrokes (WinSendKeys)  (Read 35438 times)

kikon

  • Participant
  • Joined in 2010
  • *
  • gravatar avatar
  • Posts: 19
    • View Profile
    • Donate to Member
Re: Simple Commandline to send Keystrokes
« Reply #25 on: February 11, 2011, 05:11:42 AM »
Looks like NirCmd might be able to do it.  At least, it has "sendkey" type commands, but it doesn't seem to specify a target program or window.
NirCmd  very very slowly sends commands. Last year, I've tried it

Ath

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 2,532
    • View Profile
    • Donate to Member
Re: Simple Commandline to send Keystrokes
« Reply #26 on: February 11, 2011, 06:24:41 AM »
thank you Ath, but -x doesn't work yet. I used in various way, doesn't work :(
d:\run\WinSendKeys\WinSendKeys.exe -x C:\WINDOWS\pchealth\helpctr\binaries\helpctr.exe -c

helpctr.exe just started and nothing is pasted.

Does it react to input directly after starting, or does it need some time to initialize before the paste/send action is accepted? That's currently not accounted for.
And is the focus initially in the correct (input)control? Maybe you'd need a bit of the MouseStroke options to guide the focus into the right place. Details for that are in the readme. (Handling-order is 1) Commandline parameters, 2) -f strokesfile, 3) -c clipboard contents).

Ath

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 2,532
    • View Profile
    • Donate to Member
Re: Simple Commandline to send Keystrokes
« Reply #27 on: February 11, 2011, 06:26:14 AM »
Oh, I tested -x using Notepad, as I don't have the software you're using.

Ath

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 2,532
    • View Profile
    • Donate to Member
Re: Simple Commandline to send Keystrokes (WinSendKeys)
« Reply #28 on: February 11, 2011, 02:56:18 PM »
Fired up a VMWare session with Windows XP in it and tested your scenario. That helpctr thingy is just a little slow to initialize ;)
Used -xd 2000 and all was pasted fine. but you might need to tweak that experimentally.

Without further delays: Another update WinSendKeys 3.0.1

Latest release & download moved to separate thread

The readme has this changelog since 3.0:
; 2011-02-11, version 3.0.1
; + Added -xd delay option to wait after running the -x executable_filepath. It already has the delay of -t (100 msec), and this is added when specified. Experiment with the required delay (milliseconds).
;   as additionally requested by kikon in this thread: http://www.donationc...ndex.php?topic=25553
; + This delay can be preset in the optional inifile, (see version 2.5 changelog)
;   Variable:
;   exedelay=0
; ! Updated helpmessage, fixed some readme typos

As usual, I updated the readme, compiled the AutoIt3 source into an exe, and put it all in a zipfile, attached to this post.
« Last Edit: April 23, 2011, 10:58:34 AM by Ath, Reason: Re-routed to separate thread »

kikon

  • Participant
  • Joined in 2010
  • *
  • gravatar avatar
  • Posts: 19
    • View Profile
    • Donate to Member
Re: Simple Commandline to send Keystrokes (WinSendKeys)
« Reply #29 on: February 12, 2011, 12:14:09 PM »
Hi,Ath ! many thanks  :Thmbsup: good launcher tool ! I've used these lines, both works .

WinSendKeys.exe -c -t 1000 -x helpctr.exe
WinSendKeys.exe -c -xd 1000 -x helpctr.exe

kikon

  • Participant
  • Joined in 2010
  • *
  • gravatar avatar
  • Posts: 19
    • View Profile
    • Donate to Member
Re: Simple Commandline to send Keystrokes (WinSendKeys)
« Reply #30 on: February 12, 2011, 12:37:32 PM »
... very useful tool  :up:
 for reach to any search box from one GUI such as FARR

Micha8583

  • Participant
  • Joined in 2011
  • *
  • gravatar avatar
  • Posts: 2
    • View Profile
    • Donate to Member
Re: Simple Commandline to send Keystrokes (WinSendKeys)
« Reply #31 on: March 03, 2011, 03:45:28 AM »
Hi,
do I implement WinSendKeys.exe as a batch file (like .bat) in DOS or in a command window /dos window?
Double- clicking doesn't do it  ;D
Thanks,
Mike

jgpaiva

  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 4,727
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: Simple Commandline to send Keystrokes (WinSendKeys)
« Reply #32 on: March 03, 2011, 04:15:02 AM »
Micha: yes, you need to run WinSendKeys.exe from the command line to pass it arguments

Ath

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 2,532
    • View Profile
    • Donate to Member
Re: Simple Commandline to send Keystrokes (WinSendKeys)
« Reply #33 on: March 03, 2011, 04:24:56 AM »
Most likely you can configure a command to be executed behind either a button or on a program event. There you could enter an entire command-line for WinSendKeys to do it's useful job. Or if there's not enough space, pass it a keystroke file (using the -f option), or just create a batchfile that does the job.

[shameless plug]
Can be quite nicely combined with WinButtons, published as a coding snack by myself :up:
[/shameless plug]
« Last Edit: March 11, 2011, 04:22:04 PM by Ath, Reason: Added shameless plug for combination with WinButtons »

Ath

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 2,532
    • View Profile
    • Donate to Member
Re: Simple Commandline to send Keystrokes (WinSendKeys)
« Reply #34 on: March 13, 2011, 10:41:06 AM »
OK, so I found a bug, all on my own :up:, oh well, maybe that's not so good after all :tellme:

The fix was small and easy, so here is another update WinSendKeys 3.0.2

Latest release & download moved to separate thread

Here's the changelog since 3.0.1:
; 2011-03-12, version 3.0.2
; ! BugFix in detecting an active application/window
; + Added application version to helpmessage
; * Minor cleanup
; * Adapted the helptext somewhat

The readme was cleaned-up a bit by removing the change history (it's in the source), the source and compiled exe are also included in the attachment
« Last Edit: April 23, 2011, 10:59:20 AM by Ath, Reason: Re-routed to separate thread »

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 34,950
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Donate to Member
Re: Simple Commandline to send Keystrokes (WinSendKeys)
« Reply #35 on: March 13, 2011, 10:49:35 AM »
Nice to see you keep working on this utility Ath, I like it  :up:

One thing that would make it useable more easily from my tools (like FARR for example) would be if in addition to exename and windowname, if we could pass in the window HANDLE.
« Last Edit: March 13, 2011, 10:52:53 AM by mouser »

Ath

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 2,532
    • View Profile
    • Donate to Member
Re: Simple Commandline to send Keystrokes (WinSendKeys)
« Reply #36 on: March 13, 2011, 10:52:27 AM »
Nice to see you keep working on this utility Ath, I like it  :up:

Besides me being convinced that all known bug should be "taken care of", I'm eagerly awaiting improvement suggestions... 8)

Ath

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 2,532
    • View Profile
    • Donate to Member
Re: Simple Commandline to send Keystrokes (WinSendKeys)
« Reply #37 on: March 13, 2011, 11:08:37 AM »
if we could pass in the window HANDLE.
I can take care of that :P

Another feature request taken care of: WinSendKeys 3.0.3

Latest release & download moved to separate thread

The small changelog since 3.0.2:
; 2011-03-13, version 3.0.3
; * Improvement: A numeric WindowName is now treated as a WindowHandle (HWnd), as requested by mouser

Source, exe and readme included the attachment
« Last Edit: April 23, 2011, 10:59:55 AM by Ath, Reason: Re-routed to separate thread »

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 34,950
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Donate to Member
Re: Simple Commandline to send Keystrokes (WinSendKeys)
« Reply #38 on: March 13, 2011, 11:23:48 AM »
nice! that was quick work.

Now you need a web page and a pad file so others can discover this.

Ath

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 2,532
    • View Profile
    • Donate to Member
Re: Simple Commandline to send Keystrokes (WinSendKeys)
« Reply #39 on: March 13, 2011, 11:26:36 AM »
Now you need a web page and a pad file so others can discover this.

The pad file I can take care of myself, but a site... If you could help out with that... :)

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 34,950
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Donate to Member
Re: Simple Commandline to send Keystrokes (WinSendKeys)
« Reply #40 on: March 13, 2011, 11:30:59 AM »
We are always more than happy to provide web space on the member server -- delighted in fact.

Ath

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 2,532
    • View Profile
    • Donate to Member
Re: Simple Commandline to send Keystrokes (WinSendKeys)
« Reply #41 on: April 22, 2011, 04:02:53 PM »
A few minor fixes to WinSendKeys so I've got to release today:

WinSendKeys 3.0.4

This is the small changelog:
; 2011-04-22, version 3.0.4.0
; ! Bugfix for if -? was given for parameter. It's now handled properly.
; * Added version & info resource to compiled exe
; * Changed by adding #regions to allow code-folding for a little easier maintainability

Download attached to this post, and also available from latest release & download thread and my DcMembers server page
« Last Edit: April 23, 2011, 11:01:48 AM by Ath, Reason: Re-routed to separate thread »

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 34,950
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Donate to Member
Re: Simple Commandline to send Keystrokes (WinSendKeys)
« Reply #42 on: April 22, 2011, 04:08:01 PM »
Great to see this continuing.  :up:
Might be better to not use the forum attachments for this -- otherwise old versions linger and people might download them by mistake?

wraith808

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 7,295
  • "In my dreams, I always do it right."
    • View Profile
    • wraith808
    • Donate to Member
Re: Simple Commandline to send Keystrokes (WinSendKeys)
« Reply #43 on: April 22, 2011, 06:08:47 PM »
Or maybe to make a unique thread for this, and keep updating the first post.

Ath

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 2,532
    • View Profile
    • Donate to Member
Re: Simple Commandline to send Keystrokes (WinSendKeys)
« Reply #44 on: April 23, 2011, 02:47:30 AM »
Might be better to not use the forum attachments for this -- otherwise old versions linger and people might download them by mistake?

I have been using this marker in the older posts to try to avoid that:
Quote
Updated to a newer version, see further below!

Later today I'll restructure a new message and link to the DcMembers page I already have for this :-[
And remove the attachments from the other messages (done). The latest is the greatest, ofcourse 8)

Just did that, rerouting all messages to latest release & download thread
« Last Edit: April 23, 2011, 11:03:21 AM by Ath, Reason: Re-routed to separate thread »