Type into Issue

I try to run powershell in remote desktop as a administrator then use to type into the powershell shell, however, it type into the title of the powershell windows.

How to resolve?

Hi @alex_toh,

For Type into activity properties, is simulate type checked, if yes uncheck it and try with default method or sendWindowsMessages method

2 Likes

typeinto_error_1

I checked <> click before typing then it type to the powershell but i am missing some characters.

The command i want to type is

$([ADSI]“WinNT://$env:COMPUTERNAME”).Children | where {$_.SchemaClassName -eq ‘user’} | ft name,lastlogin |Out-File C:\output1.csv

However, it type

$(“WinNT://$env:COMPUTERNAME”).Children | where {$_.SchemaClassName -eq ‘user’} | ft name,lastlogin |Out-File C:\output1.csv

into the shell.

@alex_toh
Buddy try with this just add one square bracket before to the first square bracket
it works and add double quotes in front and back of each square brackets

“$([[ADSI]”“WinNT://env:COMPUTERNAME”“).Children | where {_.SchemaClassName -eq ‘user’} | ft name,lastlogin |Out-File C:\output1.csv[k(enter)]”

image

Hope this would help you

Cheers

Thanks so much.

So does that mean I need to to do some preprocessing before I can use the type into activity to work properly.

Actually, I read the commands from a text file and stored them into array of strings then type them line by line into the powershell shell. Am I right?

Yes your are right buddy…
Did that work for you…
Cheers @alex_toh

I’m thinking of using regex to search for [xxx] and replace it with [[xxx].

and output in Message Box with szOut

I could not see the the extra [

Where did I go wrong? Sorry, I’m new to regex and just starting to use UIPath.

Put like this buddy…
Regex.Replace(strTrg.ToString,“[|”,“[[”)
.ToString

Thanks !!!

1 Like