Executing exe or bat file on remote windows machine from *nix
I prefer to use cygwin and use SSH to then log in to the windows machine to execute commands. Be aware that, by default, cygwin doesn't have OpenSSH installed.
Once you have SSH working on the windows machine you can run a command on it from the Linux machine like this:
ssh user@windowsmachine 'mycommand.exe'
You can also set up ssh authentication keys so that you don't need to enter a password each time.
How to Run a batch file in a Remote machine Using ANT?
The standard way to do this is to use the sshexec task. Problem is this assumes you have SSH running on the server.
Your use of the word batch file suggests you're running Jboss/weblogic/tomcat on a windows machine? SSH is not a common service on that platform, you'll need to first install it.
Run batch scripts on a remote server (windows) from jenkins
If Jenkins on Windows, remote on *nix, use plink.exe
(which is essentially command line PuTTy
)
If Jenkins on Windows, remote on Window, use psexec.exe
If Jenkins on *nix, remote on *nix, use ssh
If Jenkins on *nix, remote on Windows, (update 2015-01) Ansible http://docs.ansible.com/intro_windows.html has support for calling Windows commands, eg powershell, from a unix/linux machine, https://github.com/ansible/ansible-examples/blob/master/windows/run-powershell.yml
Tell me what OSes are involved (both on Jenkins and remote), and I will flash this out further.
Edit:
The download page for psexec.exe
lists all command line options. You will want something along the lines of:
psexec \\remotecomputername -u remoteusername -p remotepassword cmd /c <your commands here>
Replace <your commands here>
with actual commands as you would execute them from command prompt.
Note that psexec
first needs to install a service, and required elevated command prompt/admin remote credentials to do so.
Also, you need to run psexec -accepteula
once to accept the EULA prompt.
Out of a git console: how do I execute a batch file and then return to git console?
After playing around a bit more, I found the solution myself:
cmd "/C clean.bat"
does the trick. But I got no clue, why...
Related Topics
Kafka Console Consumer with Kerberos Authentication
Linux: Checking If a Socket/Pipe Is Broken Without Doing a Read()/Write()
Ubuntu Based Docker-Machine Image
How to Programmatically Pick and Choose Which Core of a Multi-Core CPU My Thread Should Run On
Automatically Sync Two Amazon S3 Buckets, Besides S3Cmd
Make "Git Pull" Ask for Confirmation When Pulling Different Branch
How to Send Esc/Pos Commands to Thermal Printer in Linux
Writing a Syscall to Count Context Switches of a Process
Developing a Web App with Mono (Opensource .Net) Any Examples
Linux of Equivalent Cryptprotectmemory
Are System Calls on Windows Inherently Slower Than Linux
How to Build The Elf Interpreter (Ld-Linux.So.2/Ld-2.17.So) as Static Library
Execute a Script After Every Git Push
Watermarking Video from The Linux Command Line
Can Not Install Software in Linux Error as Dpkg Was Interrupted