How to use PSExec

Hi!

Background
Finalbuilder version 7.0.0.1065 is running on a VMWare Workstation virtual machine with Windows XP.
The host is Windows Server 2003 R2 SP2 x64. The host has the latest TestComplete 8 installed.
The reason Testcomplete is installed on the host and not on the guest is that the named license is much cheaper.
The floating license (that allows running on the guest) for Testcomplete add about 2000 Euro...

The problem
In my script on the guest I want to run TestComplete on the host.
From the command line this works fine:

"C:\Program Files\PSTools\psexec.exe" \\Attracs_BM2011 -i 0 -u Attracs2\administrator -p "*PASSWORD*" "C:\Documents and Settings\Administrator.ATTRACS2\My Documents\Bats\StartTestComplete.bat"
 

When when I add PSExec action to a FB script and run it the log event look like this:

Command line : psexec \\Attracs_BM2011 -u Attracs2\administrator -p "*PASSWORD*" "C:\Documents and Settings\Administrator.ATTRACS2\My Documents\Bats\StartTestComplete.bat" -i 0
 

On the host I see the process is started in taskmanager but no window is shown and nothing happen.
I think that the -i parameter is not in right order. It must be before the bat file to execute.
I attach the PSExec Action if you can see something wrong with it.

Regards

Roland Bengtsson
Attracs Team

PSExec.xml (4.915 KB)

Hi Roland

The reason that this is not working is because you are passing ‘-i 0’ in the Parameters field in on the Program page of the action. These parameters are the parameters to be passed to the program being executed on the remote machine (in your case StartTestComplete.bat).

To enable your bat file to interact with the desktop session, enable the ‘Program interacts with remote computer’s desktop screen option’ on the Process Options page of the PsExec action. This will pass the ‘-i’ switch in the correct location.

Regards,
Steve

Hi, thanks for the answer!

But it still don't works Here is my current output from the log.

Command line : psexec \\Attracs_BM2011 -u Attracs2\administrator -p "*PASSWORD*" -i "C:\Documents and Settings\Administrator.ATTRACS2\My Documents\Bats\StartTestComplete.bat"

PsExec v1.98 - Execute processes remotely
Copyright (C) 2001-2010 Mark Russinovich
Sysinternals - www.sysinternals.com

The parameter is incorrect.
Connecting to Attracs_BM2011...

Starting PsExec service on Attracs_BM2011...

Connecting with PsExec service on Attracs_BM2011...

Starting C:\Documents and Settings\Administrator.ATTRACS2\My Documents\Bats\StartTestComplete.bat on Attracs_BM2011...

PsExec could not start C:\Documents and Settings\Administrator.ATTRACS2\My Documents\Bats\StartTestComplete.bat on Attracs_BM2011:
Return code : 87
Action Failed.

As you see there is "-i" after password but i my working example from commandline I use "-i 0" (0 for sessionid).
So how can I specify sessionid?

Regards
Roland Bengtsson
Attracs Team

Hi Roland

I have added the option to specify the session id to run the process within when running the process interactively. You will find this option on the Process Options of the PsExec action.

You can download the build that contains this feature from here:
https://www.finalbuilder.com/downloads/finalbuilder/aex6/FB700_1177.exe

Regards,
Steve

Thanks for the upgrade! It seems to work fine.

Regards

Roland Bengtsson
Team Attracs