Entering text in a textbox

Ask your Windows 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.
Posts: 1
Joined: Tue Jun 18, 2019 2:04 pm

Entering text in a textbox

Post by JackOV » Tue Jun 18, 2019 9:17 am

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

Posts: 14136
Joined: Tue May 22, 2007 9:57 am

Re: Entering text in a textbox

Post by jvierra » Tue Jun 18, 2019 9:31 am

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.