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.

Tilde in SendKeysTo string

Keywords:    tilde special characters

Question:

I have had to convert long (windows 95) names to shorter 8 character names for my program to recognize. I am using the SendKeysTo command with a variable that contains my shortened file name. Somehow, WIN batch is sending the tilde in the file name as a return. This is code right now.... is there away around this????
        SendKeysTo("Layout & Editing", "!fif%shortname%~")
Where shortname is equal to Cardin~1.pec... it types in only cardin before hitting return.

Answer:

Yes SendKeys(etc) interprets a tilde as a return. Try....
        shortname=StrReplace(shortname,"~","{~}") ; NB CURLY braces
        SendKeysTo("Layout & Editing", "!fif%shortname%~")
or (much faster):
        ClipPut(shortname)
        SendKeysTo("Layout & Editing", "!fif^v~") ;paste in filename, followed by a RETURN

Article ID:   W13831
Filename:   Sending Filename that Contains a Tilde.txt
File Created: 1999:04:15:16:56:40
Last Updated: 1999:04:15:16:56:40