Share via

Run a CMD.exe with arguments from a remote unix machine through SSH

Daniel Santos 40 Reputation points
2026-02-22T19:00:39.98+00:00

Hi,

I am trying to do the following on a Mac OS X :

ssh user@machinename "c:\windows\System32\cmd.exe /C c:\windows\notepad.exe"

, but on the remote machine's screen, no notepad window appears. I don't know if it's possible to do it like this.

I have installed OpenSSH server from windows settings and the service is running, I can log in to the windows machine.

If this is not the way to do this, is there a way ? From a non-windows machine ?

Thanks,

Regards

Windows for home | Windows 11 | Internet and connectivity
0 comments No comments
{count} votes

Answer accepted by question author
  1. Q&A Assist
    2026-02-22T19:00:50.24+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    When you use SSH to execute commands on a remote Windows machine, the commands run in a non-interactive session. This means that graphical applications like Notepad cannot display their windows on the remote machine's screen when invoked this way. The SSH session does not have access to the graphical user interface (GUI) of the Windows machine.

    If you want to run a GUI application like Notepad on a remote Windows machine, you would typically need to use a remote desktop solution, such as Remote Desktop Protocol (RDP), which allows you to interact with the Windows desktop environment directly.

    Alternatively, if you need to perform tasks that do not require a GUI, you can use command-line tools or scripts that run in the background without needing to display a window.

    For command-line interactions, you can use PowerShell remoting or other command-line utilities that are designed for remote management without the need for a GUI.


    References:

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.