1 2 3 4 5 6 7 8 9 10 11 12 13 |
$Codigo = @" using System; using System.Runtime.InteropServices; namespace NS { public class Send { [DllImport("shell32.dll", EntryPoint = "ShellExecute")] public static extern bool Shell(IntPtr HWND, string operation, string file, string parameters, string directory, int showcmd); } } "@ Add-Type $Codigo [NS.Send]::Shell([IntPtr]::Zero, "open", "C:\Windows\System32\notepad.exe","","",1) |