1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
<!DOCTYPE html> <html> <head> <title>Ejemplo de abrir Notepad desde PHP con Powershell</title> </head> <body> <h1>Abrir Notepad</h1> <form method="post"> <input type="submit" name="open_notepad" value="Abrir Notepad"> </form> <?php if (isset($_POST['open_notepad'])) { // Comando Powershell para abrir Notepad $command = 'powershell.exe -ExecutionPolicy Bypass -NoProfile -Command "Start-Process notepad.exe"'; // Ejecutar el comando exec($command); echo "<p>Notepad se ha abierto.</p>"; } ?> </body> </html> |