Automation for command prompt- Using UiPath

uiautomation
activities

#1

Hi,

how do i automate the administartive command prompt? is there a solution for it?I tired screen scraping and type into but it didnt work


#2

@Nivedita2 try to install Terminal Emulation Activities Pack and you will get all Terminal session activities.
Then you can use command prompt activities like get text, Send control key etc…


#3

@rkelchuri is there any way to open normal command prompt in administrator mode and not in uipath terminal wizard??


#4

@aksh1yadav @ddpadil team, please help Nivedita…


#5

Hey @Nivedita2

if you wanna run command prompt with different user profile you have to use runas.

Examples:

runas /noprofile /user:mymachine\administrator cmd
runas /profile /env /user:mydomain\admin "mmc %windir%\system32\dsa.msc"
runas /env /user:user@domain.microsoft.com “notepad “my file.txt””

NOTE: Enter user’s password only when prompted.
NOTE: /profile is not compatible with /netonly.
NOTE: /savecred is not compatible with /smartcard.

Sample: - RunCmdAsDiffUsers.xaml (5.0 KB)

Regards…!!
Aksh


"Run as Different User" with command line
#6

@aksh1yadav am getting an error like tis…


#7

Why you are using selectors? i m mentioned the exe path in start process. just changes your system name if it is on domain then mentioned yourdomainname\username and in type into your current user password or which profile you wanna logged in.


#8

@aksh1yadav tis is wat am runnning…yet am getting that error


#9

yes that is what i mentioned earlier.

runas /noprofile /user:mycompanydomainname\akshay.yadav cmd

*if your system is on a domain then mention a domain name as well otherwise if you are not then just pass then username only.

it works for me.

Regards…!!
Aksh


#10

@aksh1yadav how do i exe. commands in admin prompt…like instead of me typing in it , i want to autotype it…i tired “type into” but didnt wrk and “indicate on screen” is also nt wrking for admin promt.


#11

what exe you wanna type there?
or what application u wanna open with admin rights?

REgards…!!
Aksh


#12

@aksh1yadav I want to the open command prompt in admin mode and run a installation through command prompt… but am not able to auto type the commands using “type into”


#13

What command you are trying to run… like password working with type into you can pass that as well :slight_smile:


#14

@aksh1yadav can u send me an example .xaml … just to find the hostname of the system from the admin command prompt


#15

Hey @Nivedita2

I just wanted to know if you just wanna get System Host name then there is no need of admin rights you can simply get this with normal current user as well.

image

Regards…!!
Aksh


#16

@aksh1yadav thank u for tis :slight_smile: …but i have got to execute few commands in administrator prompt… so wanted to know how to type in


#17

it is the same just use the type into like that i have mentioned after password type into :slight_smile:


#18

@aksh1yadav i tried urs…yet am getting selector not found although i didnt use any… nd i want the commands to get typed in automatically in admin prompt without me typing it.:roll_eyes:. …i tried “type in” but isn’t wrking in admin prompt


#19

its working for me with the same approach.

you just have to pass the hostname with typeinto

RunCmdAsDiffUsers.xaml (5.6 KB)

Regards…!!
Aksh


#20

@aksh1yadav sry if am bothering u alot…but :slightly_frowning_face: i tried urs…it did work… but…


getting an error lyk RUNAS unable to acquire password… and also anothr 1…