I'm working on creating a single command that will run mulitple things on the command line of another machine. Here is what I'm looking to do.
- Use psexec to access remote machine
- travel to proper directory and file
- execute ant task
- exit cmd
- run together in one line
I can run the below command from Run to complete what I need accomplished but can't seem to get the format correct for psexec to understand it.
cmd /K cd /d D:\directory & ant & exit
I've tried appling this to the psexec example below:
psexec \\machine cmd /K cd /d D:\directory & ant & exit
When executing this it will activate the command line and travel to D:\directory
but won't execute the remaining commands. Adding ""
just creates more issues.
Can anyone guide me to the correct format? Or something other than psexec I can use to complete this (free options only)?
^
, I can't figure it out with this code. – Rhynd