1

I have a setup that implies calling rdesktop on a remote machine which is accessed through ssh:

user@192.168.1.110:~$ ssh user@192.168.1.120 -X

and then running rdesktop as:

user@192.168.1.120:~$ rdesktop 192.168.2.130 -u username -p password -r disk:local="./TestRDP" -s "cmd.exe /K net use C: \\\\tsclient\local & C:\\test.bat & logoff"

On the machine that rdesktop is being run on there exists a directory TestRDP in which rdesktop is called which contains a file test.bat that creates another file for testing purposes:

test.bat:

@ECHO OFF

echo "Test test test" > test_output_file.txt

Now, shouldn't file test_output_file.txt be created on the machine on which rdesktop has been called in directory TestRDP?

The linux machines are both running debian and the remote desktop machine Windows 7.

  • 1
    It seems to me that the rdesktop -s flag says "execute this on the remote (Windows) side" – Jeff Schaller Apr 12 '16 at 19:36
  • I tried variations using -s "cmd.exe", -s "echo test", -s "C:\Windows\System32\cmd.exe" but none worked. – Sebi Apr 12 '16 at 20:18
  • It seems to me that if you want the output file to be local, you would have the batch file simply echo stuff to the screen, then redirect rdesktop's output to a local file. – Jeff Schaller Apr 12 '16 at 20:35
  • It appears that I cannot launch any command using the -s parameter. Is there another way of running commands through rdesktop? When I run it with -s "cmd.exe", -s "echo test", -s "C:\Windows\System32\cmd.exe" nothing happens. rdesktop logs in and nothing else happens. – Sebi Apr 12 '16 at 20:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.