Command Prompt receives incorrect characters from Type into activity

uiautomation

#1

Scenario: Using the Type into activity into a command prompt send the incorrect keys. Typing the same command manually using the keyboard works as expected so it doesn’t appear to be a keyboard mapping issue.

Steps to reproduce: Using Type into on a command window (cmd.exe)

Current Behavior: I use the following command:

"net user robot1 /domain|find /I "“Password exp”

This is entered as:
net user robot1 'domain§find 'I ØPassword expØ

Expected Behavior: Correct keys are typed

Studio/Robot/Orchestrator Version: Studio Enterprise 2018.1.1

Last stable behavior: n/a
Last stable version: n/a
OS Version: Windows 10 Pro and Windows Server 2012 R2

This image demonstrated my manually typed command immediately followed by the robot command
image


#2

use start process activity and pass the command as an argument like this,

image

read the “abc1.txt” file for the output. this would be the better way to automate CMD. else create a .bat file dynamically and run like this.


#3

That’s a good idea. The main issue is if you want to type multiple commands then you have to launch cmd.exe for each command


#4

I managed to fix my issue. It seems that the way UiPath reads the current keyboard settings is wrong. Even though I had selected a language with Danish keyboard (as shown when I manually typed the command) UiPath somehow picked up the US keyboard. After removing an entry and setting to ENG-DA UiPath now gets the correct setting.

image


Problems ith the @sign
#5

if you write propper bat file which can fullfill your requirements (bit hard :smile:) you no need to type commands. minimal GUI interaction will improve your bot stability.


#6

Hi bobpeers,

Thanks for posting how you resolved this issue.
I just had the same problem after scheduling the robot’s job overnight.
Uipath was supposed to pick up the US keyboard but it somehow picked up the KR(Korean) keyboard.
The funny thing is that it had never done this before. (I have run the same process without problems for days)

Can you expound a little more on what entry you removed and how you changed the language settings?


#7

Hi,

I solved my problem with an approach that seems to be robust in dealing with various encoding issues. I used the Set to Clipboard Activity followed by a Send Hotkey Activity(CTRL+V) instead of using the Type Into Activity, which solved SAP encoding issues and Excel Save As encoding issues.