Sysinternals Homepage
Forum Home Forum Home > Sysinternals Utilities > PsTools
  New Posts New Posts RSS Feed - PsExec & -i To Interact w/Desktop
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

PsExec & -i To Interact w/Desktop

 Post Reply Post Reply Page  123 4>
Author
Message
sbras View Drop Down
Newbie
Newbie
Avatar

Joined: 13 December 2005
Location: United States
Status: Offline
Points: 8
Post Options Post Options   Thanks (0) Thanks(0)   Quote sbras Quote  Post ReplyReply Direct Link To This Post Topic: PsExec & -i To Interact w/Desktop
    Posted: 13 December 2005 at 11:08am

I'm finding that, no matter what combination of switches I use, I cannot get an application to appear in the foreground (as a window on the desktop) of a Windows XP Pro sp2 machine. It appears in the task list using the specified account, but is never visible. I'm using the -I and -d switches.

Should this work? If so, how?

Thanks in advance!

Back to Top
Karlchen View Drop Down
Senior Member
Senior Member
Avatar

Joined: 18 June 2005
Location: Germany
Status: Offline
Points: 5156
Post Options Post Options   Thanks (0) Thanks(0)   Quote Karlchen Quote  Post ReplyReply Direct Link To This Post Posted: 13 December 2005 at 2:33pm
psexec -i \\remote some_command
will launch some_command on the computer \\remote and the GUI of some_command will be displayed on \\remote, not on the local machine where you typed in the psexec command.

psexec -i -s regedit
will launch regedit locally (no \\remote given on the command line.) Therefore the regedit GUI will be displayed on the local machine. The user running it will be "local system" (option -s). Note: only admins can use the -s option successfully.

Does this help you? If not, kindly explain in more details what you would like to achiveve, how your psexec command line looks and what happens where.

-d only means that psexec will exit once it has launched the (remote) command. Without -d psexec will wait for the (remote) command to finish.

Karl
Back to Top
sbras View Drop Down
Newbie
Newbie
Avatar

Joined: 13 December 2005
Location: United States
Status: Offline
Points: 8
Post Options Post Options   Thanks (0) Thanks(0)   Quote sbras Quote  Post ReplyReply Direct Link To This Post Posted: 13 December 2005 at 2:43pm

The following command line:

psexec \\remote -u username -p password -i -d c:\folder\myapp.exe

Does not result in the GUI appearing on the remote machine. The task appears in the list running with the correct user account.

I've tried this with numerous executables and the result is always the same.

Thanks for your assistance with this!

Back to Top
Karlchen View Drop Down
Senior Member
Senior Member
Avatar

Joined: 18 June 2005
Location: Germany
Status: Offline
Points: 5156
Post Options Post Options   Thanks (0) Thanks(0)   Quote Karlchen Quote  Post ReplyReply Direct Link To This Post Posted: 13 December 2005 at 3:09pm
The GUI will only appear on the remote machine if
+ \\remote has been specified (obviously)
+ -i switch is used
+ myapp.exe (to use your example) is a graphical application.

The output of all console applications launched remotely will always be displayed on the local machine.
Might have made this clear from the beginning.

Karl
Back to Top
sbras View Drop Down
Newbie
Newbie
Avatar

Joined: 13 December 2005
Location: United States
Status: Offline
Points: 8
Post Options Post Options   Thanks (0) Thanks(0)   Quote sbras Quote  Post ReplyReply Direct Link To This Post Posted: 13 December 2005 at 3:13pm

I believe my situation meets all those requirements and still I see no GUI on the remote machine. It is a Windows application. Further I have tested the same command line with other Windows apps (such as Word and Excel) and always get the same results. The task appears in the list, but not on the desktop.

Thanks.

Back to Top
Karlchen View Drop Down
Senior Member
Senior Member
Avatar

Joined: 18 June 2005
Location: Germany
Status: Offline
Points: 5156
Post Options Post Options   Thanks (0) Thanks(0)   Quote Karlchen Quote  Post ReplyReply Direct Link To This Post Posted: 13 December 2005 at 3:38pm
Looks like we are using the same language, yet we have not yet agreed on how to interpret some technical terms. (No offense meant, just my impression.)

So let me suggest some definitions, i.e. how to use some terms, else we will go on talking without understanding each other.

  • local: the machine where you type in the psexec command line.
    local: psexec \\remote -u username -p password -i -d c:\folder\myapp.exe

  • remote: the machine where psexec will launch myapp.exe, \\remote in your example.

  • console application: any application that has not got a GUI, a graphical user interface. cmd.exe is a console app. psexec is a console app. telnet is a console app. ftp is a console app.

  • GUI application: any application that has got a GUI, graphical user interface. Notepad is a GUI app, Word is, Excel is.


Now, if myapp.exe is a console app and you launch it on \\remote using psexec, the process will be started on \\remote, but the output will be shown on your local machine, i.e. where you typed the psexec command.

If myapp.exe is a GUI app. and you launch it on \\remote using psexec, the process will be started on \\remote, but no GUI will be visible at all, neither on \\remote, nor on your local machine.

If myapp.exe is a GUI app. and you launch it on \\remote using psexec with the -i switch, the process will be started on \\remote, and the GUI will be visible on \\remote.

Now, kindly tell me:
  • Are you launching a GUI app or a console app?

  • On which machine do you see myapp.exe in the process list, on your local machine or on the remote machine?

  • Where do you expect to see the GUI, on \\remote or on your local machine?


Karl
--
P.S.:
The -i switch must be entered on the psexec commandline before myapp.exe, else it will not be interpreted by psexec, but passed to myapp.exe as its command line argument.

Ah, one more idea:
The user username from your example, has he got a visible screen on the machine \\remote? I mean is he logged in on the machine?
If not, I guess username will not get any graphical output, because no (virtual) screen has been assigned to him.
(psexec is not a Remote Desktop replacement, just a small telnet like console application.)



Edited by Karlchen
Back to Top
sbras View Drop Down
Newbie
Newbie
Avatar

Joined: 13 December 2005
Location: United States
Status: Offline
Points: 8
Post Options Post Options   Thanks (0) Thanks(0)   Quote sbras Quote  Post ReplyReply Direct Link To This Post Posted: 13 December 2005 at 3:45pm

myapp.exe is a GUI app, which launches on \\remote using psexec. I use -i switch, and the GUI is NOT visible on the remote.

However, the gui app appears on the remote machine's task list, under the account I specify using psexec. It's just not visible. I think we are using the same terms.

And yes, the -i switch comes before the command argument, although I've tried it in various places.

Thanks for your continued assistance.

Back to Top
Karlchen View Drop Down
Senior Member
Senior Member
Avatar

Joined: 18 June 2005
Location: Germany
Status: Offline
Points: 5156
Post Options Post Options   Thanks (0) Thanks(0)   Quote Karlchen Quote  Post ReplyReply Direct Link To This Post Posted: 13 December 2005 at 3:58pm
Fine. That's cleared. No misunderstanding, because we are using the same terms, but with different meaning.

Ok, you were quicker writing your answer, than I was adding another idea to my previous post.

The user username on \\remote might not have got a graphical contect, no screen might have been assigned to him.
Reason, he is not logged on to the machine \\remote.
It looks as if psexec can use an existing graphical context on \\remote, but it cannot create one.

After all it is more like telnet, not like Remote Desktop.

Could this be the cause? User username has not logged on to \\remote interactively.
If this is the case, you might logon to \\remote as username and the invisible GUI may become visible. (Worked for me sometimes, yet sometimes it did not.)

Karl

Back to Top
sbras View Drop Down
Newbie
Newbie
Avatar

Joined: 13 December 2005
Location: United States
Status: Offline
Points: 8
Post Options Post Options   Thanks (0) Thanks(0)   Quote sbras Quote  Post ReplyReply Direct Link To This Post Posted: 13 December 2005 at 4:08pm
Good idea; I had thought of that and did verify that the user logged on interactively is the same user that runs the task. I've been able to run the process under any account I choose, but when I use the one logged on interactively, the GUI does not appear.
Back to Top
Karlchen View Drop Down
Senior Member
Senior Member
Avatar

Joined: 18 June 2005
Location: Germany
Status: Offline
Points: 5156
Post Options Post Options   Thanks (0) Thanks(0)   Quote Karlchen Quote  Post ReplyReply Direct Link To This Post Posted: 13 December 2005 at 4:15pm
Strange. Now I'm confused. I would have expected the exact opposite.

Is \\remote a terminal server? I remember having read in this forum that on terminal servers, if you use psexec to launch a GUI app remotely, the output will always be sent to the physical monitor, not to the appropriate terminal session.

This is my last hypothesis for today, I'm afraid. - Just 1 more hour till midnight here, and another working day ahead of me.

Karl
Back to Top
 Post Reply Post Reply Page  123 4>
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.06
Copyright ©2001-2016 Web Wiz Ltd.