6

I have two computers A and B. On both computers there are two administrator accounts, 1 and 2, with their own passwords. While user 1 is logged on computer A, is it possible for user 2 on computer B to open the web browser on A\1? I have tried this:

psexec \\A cmd /c start chrome "google.com"

I believe the problem is that it is run by user 2 and not user 1. I've also tried with the -i-flag without any luck. Since user 2 is also an administrator on computer A, there should be a way. By writing

start chrome "google.com"

and putting that into the start-up folder and issuing a shutdown-command on computer A would work. But since user 2 has access to the start-up folder, it should have access to run the browser as user 2 in the first place.

All I'm trying to do is open a web browser on computer A from computer B while user 1 is logged on computer A.

Friend of Kim
  • 1,381
  • 3
  • 18
  • 25
  • try the -i switch. per the doc, it allows the command to interact with the desktop. also some apps can be controlled by the cli while displaying on the desktop, provided they are running under the same login. no idea if chrome is one of those. – Frank Thomas Jan 29 '14 at 15:43
  • @FrankThomas I already tried `-i`. Could the problem be that I'm issuing the command as user 2, while the user logged into Windows is user 1? – Friend of Kim Jan 29 '14 at 15:45
  • yes, they have to be running under the same account if you hope to have the sessions interact. – Frank Thomas Jan 29 '14 at 17:42
  • It sort of makes sense, but what doesn't make any sense is that an administrator account cannot do it anyway. An administrator can put `start chrome "google.com"` inside a .bat-file and add it to the startup folder. Then it can restart the computer and the program will launch. – Friend of Kim Jan 29 '14 at 19:50

1 Answers1

4

I had a similar situation where we had to update and then start a PowerPoint Presentation remotely. I tried dong it with psexec, and it never worked. What I ended up doing was creating a script that creates schedule task on the target computer running under a user account that's logged in. Here's a sample of the important part of the script (in PowerShell)

schtasks /create /s $targetComp /tn ppt /sc once /st $time /f /tr "'$targetComp' /s 'C:\Temp\$file'" /ru USER /rp USERPASS
schtasks /run /s $targetComp /tn ppt 
schtasks /delete /s $targetComp /tn ppt /f
shinjijai
  • 1,601
  • 14
  • 17
  • Ahh, so you need to enter the password of user 1? We regularly change the passwords. Do I have to recreate the task every time the password changes then? – Friend of Kim Jan 29 '14 at 15:44
  • What this does is create a task, runs it, then deletes it. So you just have to update the password whenever it changes. The task is not in the scheduler after it's done. – shinjijai Jan 29 '14 at 16:33
  • Of course.. I haven't used PowerShell. I usually use Linux and only know the basics with Windows "terminal". If no one can come up with a clean solution, I'll accept your answer! It certainly works, but it's sort of a hack. – Friend of Kim Jan 29 '14 at 16:37