Tuesday, November 11, 2025

How to type auto in windows 11 with powershell - sending keys in power shell

 [System.Windows.Forms.Cursor]::Position = New-Object System.Drawing.Point(100, 200)



$wshell = New-Object -ComObject wscript.shell

$wshell.AppActivate("Title of the application window") # Activate the target window

Start-Sleep -Seconds 5  # Give time for the window to activate

$wshell.SendKeys("Hello World{ENTER}")


After 5 seconds, it will paste in the window where cursor is clciked

No comments:

Post a Comment