0

I was successfully running psexec to open application on remote PC using the following command:

psexec -s -i 1 \\135.20.230.160 -u administrator -p force  calc

But suddenly today I found that 'calc' is not opening in the remote machine. Instead it is just running on the process list in task manager.

After some experiments when I changed '-i 1' to '-i 2' I found it working again.

Can anyone explain why this happened and how can I decide that the session number needs to be changed?

I need to build automation script for different users, so this is important to resolve.

Thanks.

user3565150
  • 884
  • 5
  • 21
  • 49

1 Answers1

0

You can use tasklist to display all tasks and see what session they are currently running on under the session# section.

The Psexec -i is asking for the session you would like to use.

Therefore as users log in to the machine the session numbers can be anywhere from 0 and up. To find out use tasklist with and check a process you know is running and view its session number.

Randy Rakestraw
  • 331
  • 1
  • 10