header1   header
header
header Register : : Login header
header
connector   connector
menuleft menuright
submenu   submenu
left
Make notepad visable on remote computer
Last Post 28 Oct 2010 06:13 AM by JBR. 6 Replies.
Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
skeeterUser is Offline
New Member
New Member
Posts:11
Avatar

--
10 Jun 2010 09:34 AM
    Hello All, I am trying to run a powershell script on a remote computer, and the purpose of the script is to edit a txt file then open notepad and display the edited information on the remote computer. I have accomplished everything except opening notepad on the remote computer. I can start notepad as a process but not to physically see notepad open on the remote computer. Here is my code if anyone has any ideas that would be great. I tried .visable and .show like one would in VB but that didn't work.

    $computer= "tester"
    $session = New-PSSession -ComputerName  $computer
    Enter-PSSession -session $session

    Invoke-Command -Session $session {
    $saywhat = read-host "type what you want to say"
    Add-Content c:\test.txt "'me'$saywhat"
    Invoke-Item c:\test.txt
    Start-Process notepad.exe
    }
    exit-pssession


    Thanks again for any help.
    JBRUser is Offline
    New Member
    New Member
    Posts:3
    Avatar

    --
    26 Oct 2010 04:25 AM
    Hi there.

    I think you got the same problem as me. Well, your notepad is starting, just not in the profile you want.

    That means you can press Ctrl + Shift + Esc and see the Processes running, and there will be a notepad.exe, but in another "User Name".

    I wanna know how I start the process in another profile aswell without knowing the other users credentials, but do have administrator rights on the machine.
    Joel "Jaykul" BennettUser is Offline
    Basic Member
    Basic Member
    Posts:112
    Avatar

    --
    26 Oct 2010 07:09 PM
    The only way I can think of is to generate a scheduled task to start it.
    Shay LevyUser is Offline
    PowerShell MVP, Admin
    Veteran Member
    Veteran Member
    Posts:1362
    Avatar

    --
    28 Oct 2010 01:46 AM
    You can try with psexec though it doesn't work as expected against win7 , I didn't test against other OSs.

    psexec \\pc1 -i -d notepad

    Shay Levy
    Windows PowerShell MVP
    http://PowerShay.com
    PowerShell Community Toolbar
    Twitter: @ShayLevy
    JBRUser is Offline
    New Member
    New Member
    Posts:3
    Avatar

    --
    28 Oct 2010 05:56 AM
    That was a great advice - but when I use it it starts a notepad, but the notepad is black all the way.
    You can't see the part where you write text but you can see it's a notepad.

    Any idea ?
    Shay LevyUser is Offline
    PowerShell MVP, Admin
    Veteran Member
    Veteran Member
    Posts:1362
    Avatar

    --
    28 Oct 2010 06:11 AM
    I remember it was working a long time ago, not sure why it doesn't work now.

    Shay Levy
    Windows PowerShell MVP
    http://PowerShay.com
    PowerShell Community Toolbar
    Twitter: @ShayLevy
    JBRUser is Offline
    New Member
    New Member
    Posts:3
    Avatar

    --
    28 Oct 2010 06:13 AM
    Oh ok, maybe it is because the machine I'm testing on is a Windows 7 and there is some probplems as you mentioned.
    You are not authorized to post a reply.


    Active Forums 4.3
    right
    footer   footer
    footer Sponsored by Quest Software • SAPIEN Technologies • Compellent • Microsoft Windows Server 2008 R2 footer
    footer   footer