locked
How to open a .txt file in a remote computer RRS feed

  • Question

  • I want to open a .txt file in a remote computer using invoke-command, but after execution, only can see the .notepad process in the task manager on the remote computer.

    I want to open it and see it visually on the remote computer. is there any way I can do it?

    Thanks.

    Thursday, January 24, 2019 5:36 AM

Answers

  • I want to open a .txt file in a remote computer using invoke-command, but after execution, only can see the .notepad process in the task manager on the remote computer.

    I want to open it and see it visually on the remote computer. is there any way I can do it?

    Thanks.

    This cannot be done with PowerShell remoting.  Remoting prevents any display on the monitor because a remote session does not have access to the monitor

    This question comes up frequently and has since the earliest days of Windows.


    \_(ツ)_/

    • Marked as answer by eeeww Thursday, January 24, 2019 9:09 AM
    Thursday, January 24, 2019 6:13 AM

All replies

  • Try using Invoke-Command -ScriptBlock {Start notepad "path to yout text file"}

    Siva Sankar

    Thursday, January 24, 2019 6:09 AM
  • Hello Dear,

    Try these commands:

    $Session = New-PSSession -name session01 -computerName Server-01

    $a=Invoke-Command -session $session -scriptblock {Get-Process}

    $a | Out-File "$env:USERPROFILE\Desktop\MyData.Txt"

    Thanks & Best Regards,

    Abhishek Sachdeva

    Please mark this answer if it is helpful for you.

    Thursday, January 24, 2019 6:09 AM
  • I want to open a .txt file in a remote computer using invoke-command, but after execution, only can see the .notepad process in the task manager on the remote computer.

    I want to open it and see it visually on the remote computer. is there any way I can do it?

    Thanks.

    This cannot be done with PowerShell remoting.  Remoting prevents any display on the monitor because a remote session does not have access to the monitor

    This question comes up frequently and has since the earliest days of Windows.


    \_(ツ)_/

    • Marked as answer by eeeww Thursday, January 24, 2019 9:09 AM
    Thursday, January 24, 2019 6:13 AM
  • Hello Dear,

    Try these commands:

    $Session = New-PSSession -name session01 -computerName Server-01

    $a=Invoke-Command -session $session -scriptblock {Get-Process}

    $a | Out-File "$env:USERPROFILE\Desktop\MyData.Txt"

    Thanks & Best Regards,

    Abhishek Sachdeva

    Please mark this answer if it is helpful for you.


    Did u even read and understand his question?
    Thursday, January 24, 2019 6:26 AM