remote start application by powershell

asked 2020-08-27T07:52:04.287+00:00
Yendy Hui 21 Reputation points

I access to remote computer via ssh and running powershell as AS to execute the following command but I can't see the Notepad++ running on remote computer.

Invoke-Item -Path C:\Users\Dex\Desktop\Notepad++.lnk

or

Start-Process -FilePath C:\Users\DDhami\Desktop\Notepad++.lnk

Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
4,617 questions
No comments
{count} votes

Accepted answer
  1. answered 2020-08-31T17:36:40.1+00:00
    SethWH 431 Reputation points

    Let me give you an example with Notepad:

    Query the remote server to find the session ID you want to start a program in:

    PsExec  \\MyServer01 -u Administrator -p MyPassword query session
    

    A list of session IDs will be displayed so look for the RDP or console session ID you want to start Notepad in. In my example, my RDP session is ID 2. Run the following command to start notepad remotely:

    psexec \\MyServer01 -u Administrator -p MyPassword -d -i 2 C:\Windows\System32\notepad.exe
    

    If you receive a message like "notepad.exe started on MyServer01 with process ID XXXX," check the remote session to verify notepad is open on the desktop.


1 additional answer

Sort by: Most helpful
  1. answered 2020-08-27T16:13:13.043+00:00
    SethWH 431 Reputation points

    Notepad++ will probably be visible in the Task Manager but not on your Desktop or RDP session. You can find more information here:

    powershell-using-start-process-in-pssession-to-open-notepad

    psexec is tool you could use though.