I want my powershell/batch/vbscript to be able to copy a text start notepad and then paste it I found how to copy which is here but I don’t know how to paste it any ideas how can I do it without third party tools?


Solution 1:

This is a very common thing. A quick web search would show you many.

powershell 'capture and send output to notepad'

Just use SendKeys and pass CRTL+V.

Pass your content to the clipboard

Example:

Get-NetIPConfiguration | clip | notepad
Sleep -Seconds 1
Add-Type -AssemblyName System.Windows.Forms
[System.Windows.Forms.SendKeys]::SendWait('^V')

Or use other pre-built examples that already exist for this use case as shown in the link provided.