WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Sending Keystrokes

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Problem Sending a Dash Character

 Keywords:  Problem Send Key SendKey SendKeysTo - Dash Minus Character

Question:

SendKeysTo will NOT get the " - " part of each dirname into the "Enter file mask" input field. If I type it in by hand, the " - " part is excepted by SyncBackSE.

For this failure example, I also did a SendKeysTo to a manually open Notepad.exe window. It does NOT get the " - " key sequence sent to Notepad either. I found this problem this week with Winbatch 2010A and then upgraded to 2010C with the same failure.

dirname = "CT – 128 Inch Wide Reel Trailer\*"
   SendKeysTo("~Notepad", dirname)
   SendKeysTo("~Notepad", @CRLF)

   dirname = "SPU-270F N2 SKID – 96.0 Inch WIDE\*"
   SendKeysTo("~Notepad", dirname)
   SendKeysTo("~Notepad", @CRLF)

Answer:

The 'SendKeys' and 'SendKeysTo' functions only work with characters that Windows provides virtual-key codes for. Windows does not provide a virtual-key code for the ANSI character with the code point of 150 (sometimes referred to as the En Dash) so the functions do not support sending that character. If you are not a strict grammarian, you could simply 'StrReplace' the en dash with a dash before using 'SendKeysTo' or your might be able to use the clipboard functions instead of 'SenKeysTo'.
Article ID:   W18269
Filename:   Problem Sending a Dash Character.txt
File Created: 2010:08:19:09:48:22
Last Updated: 2010:08:19:09:48:22