SendText results in ^ characters

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
SandyDoss
Junior Coder
Posts: 40
Joined: Wed Sep 07, 2016 12:47 am

SendText results in ^ characters

Post by SandyDoss » Fri Sep 23, 2016 12:37 am

So. I am writing a script that uses Remote Desktop to connect to an outside server, log into an application, run a report, save it to the login default Documents folder. All this works beautifully :)

Now, I need to copy the file back to the local pc. Because I am on remote desktop, my thought was to bring up the start menu, click on the Command Prompt entry, send text to the command window to copy the file back to the local server. Easy peasy.

Not.

The portion of my script to open the command prompt, execute the copy command, exit the prompt is below:

Code: Select all

SetFocus>SWUniversity4*
Press CTRL
Press Esc
Release Esc
Release CTRL
Wait>1
Press Down *2
Wait>2
Press Enter
Wait>3
Let>SK_DELAY=10
SendText>copy /Y Documents\rptStudentSchedule.txt \\tsclient\C\DiamondD_Robots\Reports\
Wait>1
Press Enter
Wait>10
SendText>exit
Press Enter
The remote system is already logged on. (The SetFocus is because I've hacked this out of my entire script.)
^Escape pulls up the start menu. Down twice highlights the Command Prompt entry. The Command window pops up nicely, thank you very much. BUT....when I run the script, either from debug mode or not, my copy command results in the following:
Microsoft Windows [Version 6.0.6002]
Copyright (c) 2006 Microsoft Corporation. All rights reserved.

C:\Users\Sandy.Doss>

C:\Users\Sandy.Doss>^O^P^Y ^Y ^D^O

C:\Users\Sandy.Doss>^U
'§' is not recognized as an internal or external command,
operable program or batch file.

C:\Users\Sandy.Doss>^E^N^T^R^P^T^U^D^E^N^T

C:\Users\Sandy.Doss>^E^D^U^L^E^T^X^T ^\^\^T

C:\Users\Sandy.Doss>AppData^E^N^T^\

C:\Users\Sandy.Doss>^\^D^A
'∟♦☺' is not recognized as an internal or external command,
operable program or batch file.

C:\Users\Sandy.Doss>^O^N^D^D^_^R^O^B^O^T^R^E^P^O^R^T
Yikes! And, the kicker is, I can step through the script beginning at the SendText to send the copy command, and it works just fine! I've tried lengthening the wait time between script lines, and the delay time in sending the characters. No luck.

I'm sure there is a simple answer. But it's half past six o'clock and I'm ready for home! Any pointers would be gratefully accepted :)

User avatar
JRL
Automation Wizard
Posts: 3501
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Re: SendText results in ^ characters

Post by JRL » Fri Sep 23, 2016 3:39 am

Looks to me like you have somewhere set a "Press Ctrl" without a corresponding "Release Ctrl". Open a command prompt and type "robot" while holding down the ctrl key. This is what I get.

^R^O^B^O^T

SandyDoss
Junior Coder
Posts: 40
Joined: Wed Sep 07, 2016 12:47 am

Re: SendText results in ^ characters

Post by SandyDoss » Fri Sep 23, 2016 3:48 pm

JRL, yes, I thought of that; however, I've pulled out from the original script only those things I posted here and put them in their own script. One Press Ctrl, one Press Esc, one Release Esc, one Release Ctrl.

Have changed to specify LCTRL in the Press and Release commands. Worked like a charm.

Thanks so much!

Post Reply
cron
Sign up to our newsletter for free automation tips, tricks & discounts