I'm running the following through a remote PHP script that connects to SSH:
cmd /C start "" /MAX /b "C:\Windows\System32\notepad.exe"
The process does start however it remains in the background and will not open fully on the remote desktop. Is there any way to get it to work interactively (like how PSExec has the -i flag)?
Edit:
So the PHP connects to SSH with ssh2_connect
then uses ssh2_exec
in the following manner:
if (!($stream = ssh2_exec($con, $shcom ))) {
where $shcom
is the command passed to the SSH, such as:
$shcom = 'cmd.exe /C start "" /MAX "%SystemRoot%\System32\calc.exe"';
I have previously used PSExec and PuTTY (note not via the PHP script) to manually open notepad.exe on a remote machine via the following:
cd "C:\Program Files\PSExec\" & psexec \\localhost -i 2 -ds "C:\Windows\System32\notepad.exe"
which did successfully work however this also does not properly function via PHP. At present neither CMD nor PSExec can bring up an interactive application in the foreground automatically.