[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