Running commands on Windows from Linux, through ssh

Post by Nico Brailovsky @ 2011-09-22 | Permalink | 1 comments | Leave a comment

Running Windows is something I don't usually like (running of Windows is a different story) but having to run something on Windows command line interface is something I wouldn't wish even to my worst enemies. I was stuck in that situation, don't remember why, but I needed to run a command in a Windows machine, automatically, and I only had ssh (is there a better way of automating scripted tasks in Windows, remotely and without a GUI?). Well, this is what I came up with:

ssh host cmd /c dir

Running that in a bash shell will show the directory listing of C: in machine "host". Ugly as hell, but it's a good way of kickstarting a batch script.


In reply to this post, Links 24/9/2011: Linux 3.1 RC7, Plasma Active OS | Techrights commented @ 2011-09-24T15:51:12.000+02:00:

[...] Running commands on Windows from Linux, through ssh [...]

Original published here.