Entering text in a textbox

Ask your PowerShell-related questions, including questions on cmdlet development!
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 4 years and 9 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
JackOV
Posts: 1
Last visit: Tue Jun 18, 2019 9:17 am

Entering text in a textbox

Post by JackOV »

Hi, I am new to Powershell and wonder if it can do this: Enter text in a textbox of an opened application. (I installed ps v5.1 and 6.1).
The following example gives no error but does not work either, why not?

$a = "100"
$b = get-process -name Program5 | get-member -name txtAmount
set-content -value $b $a
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: Entering text in a textbox

Post by jvierra »

You cannot access parts of a form running in another process. This is not p[possible with Windows. Forms controls are not members of a process object. No program internals or data is ever exposed by a process. This is just basic Windows behavior and has nothing to do with scripting. It is part of the built in security of Windows and almost any other OS on the planet.
This topic is 4 years and 9 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked