D
D
doneon2022-02-26 17:52:13
PowerShell
doneon, 2022-02-26 17:52:13

How to write a simple powershell keypress script?

You need to write a simple Powershell script. Task: Opening an application and pressing keys with expectation.
I would be grateful for any example.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
rPman, 2022-02-26
@doneon

run application with &
to press buttons, you can use WScript.Shell

$myshell = New-Object -com "Wscript.Shell"
$myshell.sendkeys("q")
Start-Sleep -m $delay

ps very inconvenient you chose a tool for the task
there is a specialized autoit with a language, compiler, editor and a bunch of other utilities

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question