cancel
Showing results for 
Search instead for 
Did you mean: 

while entering password through command prompt, password is not recognized as an internal command

rokkam_saiteja
Level 4

Hi All,

while entering password through command prompt by bot encountered an issue like password is not recognized as an internal command 

Please find the password that I'm using

Password: {T3|RJ7qkxcwH}l98biVdS[MY 

after handling and escaping special characters

updated password: {{}T3|RJ7qkxcwH{}}l98biVdS[MY

rokkam_saiteja_0-1719322095162.png

Please assist me. Thanks in advance

1 BEST ANSWER

Helpful Answers

Hi @rokkam_saiteja ,

What you are trying to achieve would totally rely on Global Send Keys and with Global Send Keys the limitations are around special characters such as {, }, [,], ( or ) that you would always need to escape using parentheses '{}'. However, for pipe symbol, I don't believe there is any limitation. You can see from the below screenshot, when I tried using the same calculation formula which I provided in my prior thread, I am able to write into Notepad (which means Global Send Keys will support it no matter which application you use):

devneetmohanty07_0-1719381290555.png

 

Now, coming to the part around stability, I always suggest avoiding UI based CMD automation whenever any case as such arises. Reason being, there are limitations when it comes to special characters and secondly the application must remain on a foreground state that can be impacted at any point in a LIVE staging platform. For your use case though, runas command has this security implication where it would always give out a popup window for entering password so there is unfortunately no way to bypass this screen even if we write a batch script which is always the best preferred way.

However, there is an utility by Microsoft itself called as PsExec. It basically includes launching interactive command-prompts on remote systems and remote-enabling tools which can actually help us to achieve the same results that we want via runas command.

You need to download the compressed zip utility from the link that I provided above and then extract the contents and save it in some preferred location (I would say C drive):

devneetmohanty07_1-1719381673458.png

 

Now, you can simply go to Start menu and search for 'Environment Variables' and add this path to the PATH environment variable as shown below:

devneetmohanty07_2-1719382069266.png

Please note this step you need to do in every machine where you intend to run this automation (Runtime Resources)

 

Now, you can simply run the utility with the same Start Process action with slightly different parameters. Here instead of runas you would use psexec:

Application: psexec

Arguments: -u <DOMAIN_NAME>\<USERNAME> -p <PASSWORD> <APPLICATION_PATH>

NOTE: Please provide spaces between each flags and parameters in the above expression.

In my example, I have opened up Chrome using the same:

devneetmohanty07_3-1719382958171.png

 

This utility would ensure that you do not need to escape any special characters as you are not using Global Send Keys and moreover, since this is a Microsoft utility itself there should not be any security implications to have it run on your machines.

If this route does not work, then you would need to rely on Global Send Keys and the calculation expression that I provided earlier still should be able to help you out.

 

 

 

---------------------------------------------------------------------------------------------------------------------------------------
Hope this helps you out and if so, please mark the current thread as the 'Answer', so others can refer to the same for reference in future.
Regards,
Devneet Mohanty,
SS&C Blueprism Community MVP 2024,
Automation Architect,
Wonderbotz India Pvt. Ltd.

View answer in original post

8 REPLIES 8

Hi @rokkam_saiteja ,

It might be a bit difficult to understand exactly which CMD command you are trying to execute involving password that causes this error. Can you please tell us the whole command?

From a Send Global Keys Stroke perspective, you need to escape '{', '}' and '[' in your password text by enclosing these characters within '{}'. For this you can use a calculation stage and replace these characters with '{}' using the below expression:

Replace(Replace(Replace(Replace(Replace(Replace([TxtTextToWrite], "[","Start[End"), "]","Start]End"), "}","Start}End"),"{","Start{End"), "Start", "{"), "End", "}")

Considering, TxtTextToWrite is the data item which holds the password value, this calculation will ensure the characters got escaped properly.

---------------------------------------------------------------------------------------------------------------------------------------
Hope this helps you out and if so, please mark the current thread as the 'Answer', so others can refer to the same for reference in future.
Regards,
Devneet Mohanty,
SS&C Blueprism Community MVP 2024,
Automation Architect,
Wonderbotz India Pvt. Ltd.

Thank you so much @devneetmohanty07 

We are using Environment Utility (nologging) -Start Process where the input parametrs are as

rokkam_saiteja_0-1719376580817.png

Application - "runas"

[Application and Path]:

CMD /K net use Z: \\pccsfs06.proteccoating.com\shares\Robotic_Process_Automation /user:RPA_User_Protec {T3|RJ7qkxcwH}l98biVdS[MY

Command: CMD /K net use Z: " & [Protec Folder] & " /user:" & [UserName] & " " & [Password]

Note: We already handled the special characters which may come in password data item expect the Pipe Line Character "|" .

[Character] = "{" OR [Character] = "}" OR [Character] = "+" OR [Character] = "^" OR [Character] = "%" OR [Character] = "~" OR [Character] = "(" OR [Character] = ")" OR [Character] = "$" OR [Character] = "!" OR [Character] = "[" OR [Character] = "]"

just placing the character within the "{[Character]}"

From source of internet we tried Caret(^) to escape the pipe character still facing the same issue.

Previously its worked but when we get the password contains pipe character ("|") at that time facing issue

Is there any alternative way to stable the CMD while entering password contains such Characters

Actaul Password:{T3|RJ7qkxcwH}l98biVdS[MY

Updated Password:{{}T3|RJ7qkxcwH{}}l98biVdS{[}MY

We are using Global Send key events to enter the [Updated password] in CMD

rokkam_saiteja_2-1719377677511.png

Thanks. Please let me know what I can do to solve this issue.

 

 

 

Hi @rokkam_saiteja ,

What you are trying to achieve would totally rely on Global Send Keys and with Global Send Keys the limitations are around special characters such as {, }, [,], ( or ) that you would always need to escape using parentheses '{}'. However, for pipe symbol, I don't believe there is any limitation. You can see from the below screenshot, when I tried using the same calculation formula which I provided in my prior thread, I am able to write into Notepad (which means Global Send Keys will support it no matter which application you use):

devneetmohanty07_0-1719381290555.png

 

Now, coming to the part around stability, I always suggest avoiding UI based CMD automation whenever any case as such arises. Reason being, there are limitations when it comes to special characters and secondly the application must remain on a foreground state that can be impacted at any point in a LIVE staging platform. For your use case though, runas command has this security implication where it would always give out a popup window for entering password so there is unfortunately no way to bypass this screen even if we write a batch script which is always the best preferred way.

However, there is an utility by Microsoft itself called as PsExec. It basically includes launching interactive command-prompts on remote systems and remote-enabling tools which can actually help us to achieve the same results that we want via runas command.

You need to download the compressed zip utility from the link that I provided above and then extract the contents and save it in some preferred location (I would say C drive):

devneetmohanty07_1-1719381673458.png

 

Now, you can simply go to Start menu and search for 'Environment Variables' and add this path to the PATH environment variable as shown below:

devneetmohanty07_2-1719382069266.png

Please note this step you need to do in every machine where you intend to run this automation (Runtime Resources)

 

Now, you can simply run the utility with the same Start Process action with slightly different parameters. Here instead of runas you would use psexec:

Application: psexec

Arguments: -u <DOMAIN_NAME>\<USERNAME> -p <PASSWORD> <APPLICATION_PATH>

NOTE: Please provide spaces between each flags and parameters in the above expression.

In my example, I have opened up Chrome using the same:

devneetmohanty07_3-1719382958171.png

 

This utility would ensure that you do not need to escape any special characters as you are not using Global Send Keys and moreover, since this is a Microsoft utility itself there should not be any security implications to have it run on your machines.

If this route does not work, then you would need to rely on Global Send Keys and the calculation expression that I provided earlier still should be able to help you out.

 

 

 

---------------------------------------------------------------------------------------------------------------------------------------
Hope this helps you out and if so, please mark the current thread as the 'Answer', so others can refer to the same for reference in future.
Regards,
Devneet Mohanty,
SS&C Blueprism Community MVP 2024,
Automation Architect,
Wonderbotz India Pvt. Ltd.

@devneetmohanty07 

Thank you so much for the valuable information you provided.

Sorry to say that we don't have any permissions to download the Microsoft utility to do so in the Client VM as access is restricted.

But I have tried the above-mentioned calculation expression but still the same issue

Update Password :{{}T3|RJ7qkxcwH{}}l98biVdS{[}MY

rokkam_saiteja_0-1719394022938.pngrokkam_saiteja_1-1719394084649.png

Using existing action is there any solution to overcome the issue.

Once again thanks.

 

Hi @rokkam_saiteja ,

 

The updated password ({{}T3|RJ7qkxcwH{}}l98biVdS[MY) should work with Global Send Keys. I also tested the same on my CMD application and as you can see I am able to enter the password:

devneetmohanty07_0-1719401925936.png

From your screenshot, I can see that it did not even enter the first few characters, which most likely can be an issue due to application not being activated properly before the Send Global Keys action started working.

Can you try to use a navigate stage to activate the application first using the Screen element which most likely has been spied in Win32 spying mode, then provide a delay of few seconds and then use this navigate stage with root application element to type into the text.

 

 

---------------------------------------------------------------------------------------------------------------------------------------
Hope this helps you out and if so, please mark the current thread as the 'Answer', so others can refer to the same for reference in future.
Regards,
Devneet Mohanty,
SS&C Blueprism Community MVP 2024,
Automation Architect,
Wonderbotz India Pvt. Ltd.

Hi @devneetmohanty07 

Tried the same by activating the application and wait for the 10 sec ,then entering password 

rokkam_saiteja_0-1719403292627.png

still same issue

rokkam_saiteja_1-1719403454743.png

 

 

Hi @rokkam_saiteja ,

This is most likely because you are not enclosing the password within double quotes in your command:

When you evaluate the expression you should see the below line:

CMD /K net use Z: \\pccsfs06.proteccoating.com\shares\Robotic_Process_Automation /user:RPA_User_Protec "{T3|RJ7qkxcwH}l98biVdS[MY"

As you can see the password is enclosed with double quotes. You need to also have this double quote character in your final string.

You can see I got the same error when I tried it the first time without double quotes and the next time error was expected as I do not have this network path but the command was correct:

 

devneetmohanty07_0-1719416022390.png

 

---------------------------------------------------------------------------------------------------------------------------------------
Hope this helps you out and if so, please mark the current thread as the 'Answer', so others can refer to the same for reference in future.
Regards,
Devneet Mohanty,
SS&C Blueprism Community MVP 2024,
Automation Architect,
Wonderbotz India Pvt. Ltd.

Hi @devneetmohanty07 

I have enclosed the update password within double quotes and tested the same but while inputting password cmd getting closed automatically.