Question: How to open GUI based program on remote computer?

frostbyte5014

Active Member
Reaction score
51
Location
Greenwood, SC USA
Well I don't have any hair left to pull out. I been trying to a program to open on remote computer by sending remote command through ScreenConnect. I haven't had any luck. Been trying to use PSExec but nothing ever happens on the remote computer. Have tried running script on remote computer but that didn't work either.

Does anyone have a solution?

Seems like there would be a tool like PSExec that could handle this.

Thanks
 
The problem is that SC runs the commands under the Local System Account. You need to run the program as the logged in user, using the -i argument to allow interaction with the desktop and the correct session ID (which will probably be 1). So for example:

Code:
c:\pstools\psexec -u username -p password -i 1 -d notepad.exe

(It should be possible to determine the correct session ID using the tasklist command)

EDIT: Actually, the command 'query session' will probably be better to determine the user's session ID.
 
Last edited:
That didn't work Moltuae but thanks anyway. After trying about a hundred variations, this is what finally worked.
psexec.exe -i 1 -accepteula -u %userdomain%\adminuser -p adminpass "C:\windows\notepad.exe"

It appears that (%userdomain%\adminuser) was needed to properly elevate the permissions.

I also notice that this command worked if the exe was in the windows folder as apposed to c:\folder.

Another powerful option I found was to package any gui based exe that I need to run on a remote computer in a self extracting zip using winrar with elevated permissions. Here's the how to http://www.howtogeek.com/119953/how-to-clean-a-windows-pc-on-your-network-remotely-with-ccleaner/
 
Last edited:
That didn't work Moltuae but thanks anyway. After trying about a hundred variations, this is what finally worked.
psexec.exe -i 1 -accepteula -u %userdomain%\adminuser -p adminpass "C:\windows\notepad.exe"

It appears that (%userdomain%\adminuser) was needed to properly elevate the permissions.

I also notice that this command worked if the exe was in the windows folder as apposed to c:\folder.
Ah, you never mentioned the computer was on a domain. The example I posted works on a non-domain machine.

Also, you shouldn't need -accepteula once psexec has been run once and the EULA has been accepted.

Another powerful option I found was to package any gui based exe that I need to run on a remote computer in a self extracting zip using winrar with elevated permissions. Here's the how to http://www.howtogeek.com/119953/how-to-clean-a-windows-pc-on-your-network-remotely-with-ccleaner/

Neat :)
 
It's not on a domain. Just a workgroup but the command would not run till I used the domain\user. I tested it several time with and without. I put the accepteula in my example cause a lot of people forget to insert it. I just leave it in my scripts that way I never forget it. It won't hurt anything.
 
Good idea. Strange that you need the domain\ part to get it to work. The example I posted works every time for me.
 
Back
Top