0

I have an exe file, that install something on my remote windows machine.

I have some bash script to that should transfer this file to remote windows machine and execute that exe file on that remote windows machine.

This bash script is triggered via some automated pipeline, jenkins.

Can someone help me with the process to achieve this?

What have i tried:

I am totally new to windows remote access. I have done one with RDP and have tried winexe (https://www.aldeid.com/wiki/Winexe#Installation_of_winexe), but that is failing to install with error :

make basics ~/bin/winexe Creating heimdal/lib/asn1/der-protos.h syntax error at heimdal/cf/make-proto.pl line 15, near "do Getopts(" Execution of heimdal/cf/make-proto.pl aborted due to compilation errors. data.mk:195: recipe for target 'heimdal/lib/asn1/der-protos.h' failed make: *** [heimdal/lib/asn1/der-protos.h] Error 255

codeofnode
  • 18,169
  • 29
  • 85
  • 142

1 Answers1

0

If you have Access to the remote Windows machine, you could install a SFTP/SSH server there, see this e.g.

With that, you should be able to:

  1. Secure copy the file from you Ubuntu command line

    scp <your_file> user@ip_win_server:<target location>
    
  2. Either

    1. Send a command to the Windows server via ssh

      ssh user@ip_win_server "your command"
      
    2. Use Winexe.

Useful refs:

https://zaiste.net/posts/a_few_ways_to_execute_commands_remotely_using_ssh/

How to execute a remote command over ssh with arguments?

https://unix.stackexchange.com/questions/171331/how-to-execute-windows-commands-remotely-from-linux-machine-using-rdesktop-comma

How to activate programs on windows from Linux machine

Copying a file remotely from Ubuntu to Windows 7

(an old one) https://serverfault.com/questions/10468/ssh-scp-server-on-windows