web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / CMD 'Please enter' fol...
Power Automate
Answered

CMD 'Please enter' follow up commands

(2) ShareShare
ReportReport
Posted on by 14
Hello -
 
I'm attempting to use CMD to generate an SSH key using the command ssh-keygen. If you don't specify all of the parameters, CMD will prompt you to enter in that information.
 
For example, if I simply type in 'ssh-keygen' into command, I'll be asked: 
 
'Enter file in which to save the key'
 
If I use the read from CMD prompt, it will not show this text. How do we handle this in PAD? Can PAD handle this?
 
Thank you. 
I have the same question (0)
  • Verified answer
    harish_sada Profile Picture
    53 on at
     
     
     
     
     

    Copy and paste the code below into PAD
     
    System.RunApplication.RunApplication ApplicationPath: $'''C:\\Windows\\system32\\cmd.exe''' WorkingDirectory: $'''C:\\Users\\''' WindowStyle: System.ProcessWindowStyle.Normal ProcessId=> AppProcessId
    WAIT 5
    UIAutomation.GetWindow.GetForegroundWindow WindowTitle=> WindowTitle WindowInstance=> AutomationWindow
    WAIT 5
    MouseAndKeyboard.SendKeys.FocusAndSendKeys TextToSend: $'''ssh-keygen {Enter}''' DelayBetweenKeystrokes: 30 SendTextAsHardwareKeys: False
    WAIT 10
    MouseAndKeyboard.SendKeys.FocusAndSendKeys TextToSend: $'''key3 {Return}''' DelayBetweenKeystrokes: 30 SendTextAsHardwareKeys: False
    WAIT 10
    MouseAndKeyboard.SendKeys.FocusAndSendKeys TextToSend: $''' {Return} {Return}''' DelayBetweenKeystrokes: 30 SendTextAsHardwareKeys: False
    WAIT 2
    MouseAndKeyboard.SendKeys.FocusAndSendKeys TextToSend: $'''exit{Enter}''' DelayBetweenKeystrokes: 30 SendTextAsHardwareKeys: False
    Folder.GetFiles Folder: $'''C:\\Users\\''' FileFilter: $'''*.pub''' IncludeSubfolders: False FailOnAccessDenied: True SortBy1: Folder.SortBy.NoSort SortDescending1: False SortBy2: Folder.SortBy.NoSort SortDescending2: False SortBy3: Folder.SortBy.NoSort SortDescending3: False Files=> Files
    SET NewVar2 TO Files[0]['FullName']
    File.ReadTextFromFile.ReadTextAsList File: NewVar2 Encoding: File.TextFileEncoding.DefaultEncoding Contents=> Key
    MouseAndKeyboard.SendKeys.FocusAndSendKeys TextToSend: $''' {Return} {Return}''' DelayBetweenKeystrokes: 30 SendTextAsHardwareKeys: False

     
     
     
  • deimospwns Profile Picture
    14 on at
    thank you for the reply, harish!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 519 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 296 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard