Send Keys in Powershell alt+n {TAB} {ENTER}

后端 未结 1 909
梦谈多话
梦谈多话 2020-12-20 09:09

Am in process of automating the daily download of a zip file from secure site. Script is ready which uses the internet explorer to login and go to the required location and

相关标签:
1条回答
  • 2020-12-20 09:40

    To emulate send keys you want to use System.Windows.Forms.SendKeys class.

    The plus sign (+), caret (^), percent sign (%), tilde (~), and parentheses () have special meanings to SendKeys. To specify one of these characters, enclose it within braces ({})

    In your case, according to documentation, code sample should look like:

    Add-Type -AssemblyName System.Windows.Forms
    [System.Windows.Forms.SendKeys]::SendWait("%n{TAB}{ENTER}")
    

    Where:

    • % stands for ALT button;
    • n stands for n button;
    • {TAB} stands for TAB button;
    • {ENTER} stands for ENTER button.

    Please follow the documentation page to can see complete list of available options here.

    0 讨论(0)
提交回复
热议问题