1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
#Abrir Notepad en una posición y después indicarle otra en la función MoveWindow Add-Type @" using System; using System.Runtime.InteropServices; public class Win32 { [DllImport("user32.dll")] public static extern bool MoveWindow(IntPtr hWnd, int X, int Y, int nWidth, int nHeight, bool bRepaint); } "@ $Script=New-Object -ComObject WScript.Shell $Proceso=Get-Process notepad #$Proceso=Get-Process mspaint $Script.AppActivate($Proceso.MainWindowTitle) [Win32]::MoveWindow(($Proceso).MainWindowHandle, 100, 200, 300, 400, $true) |