user3565150
user3565150

Reputation: 914

Python error while trying to run application on remote desktop

I am trying run the following script which will help me to open a SSH connection on a remote windows desktop and open an application in that remote desktop. I am getting an error when I read the error buffer:

import paramiko
ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh.connect('135.24.237.178',username = 'cyg_server',password = 'sandforce')

stdin,stdout,stderr = ssh.exec_command("C:\\Program Files\\Tensilica\\Xtensa    
OCD Daemon 9.0.3\\xt-ocd.exe")

stderr.readlines()
[u'bash: C:Program: command not found\n']

stdout.readlines()
[]

Seems I am not giving the path of the application I want to run on the remote PC correctly. Can anyone help ?

Thanks.

Upvotes: 1

Views: 1430

Answers (2)

clockwatcher
clockwatcher

Reputation: 3363

I'm guessing you're using cygwin to provide your SSH server on windows. If so, you should reference your path through /cygdrive/c. Try:

ssh.exec_command("/cygdrive/c/Program\ Files/Tensilica/Xtensa\ OCD\ Daemon\ 9.0.3/xt-ocd.exe")

Actually, you probably want a raw string as you'll want to pass the backslashes through to cygwin.. so... if the above doesn't work try...

ssh.exec_command(r"/cygdrive/c/Program\ Files/Tensilica/Xtensa\ OCD\ Daemon\ 9.0.3/xt-ocd.exe")

Upvotes: 1

John Zwinck
John Zwinck

Reputation: 249293

Try escaping the space, like this:

ssh.exec_command("C:\\Program\ Files\\...

Upvotes: 0

Related Questions