Running commands on Windows from Linux, through ssh

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.

Advertisements

One Comment on “Running commands on Windows from Linux, through ssh”

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


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s