I am actually not sure that this is possible. let's see:
I have a script that runs on a Build server. Let's name this server A.
It drops the bins to a shared folder on server B.
And I want to run the program on server C.
So using caspol I can allow the executable to be ran remotely.
that means from B I can run \C\shared\my.exe
What I want to do is from A run \C\shared\my.exe on B.
SysInternals\PsExec.exe -u username -p password -accepteula \\ServerC -i 0 -d -w \\ServerB\Nightly\Server \\ServerB\Nightly\Server\server.exe
The user has all the necessary rights.
But, the -w (working directory) options apparently wants a path relative to the server I point to.
Any idea?
Best Answer
Without knowing what your application does, do you need to define the working path? I may be wrong, but I don't believe UNC paths are supported? What about a little trickery, and doing a map of a network drive, and bundle it up in a script? Something like:
Put this in a script, then call it using psexec:
The pushd command maps the next available drive letter to the share, and then changes directory to that new map. popd returns back to the previous path, and unmounts the drive.