Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I successfully conntected to a windows machine in LAN via grdesktop. Now I would like to have a script which copies a *.bat file and executes it on the windows machine via rdesktop. Any suggestions? Thanks in advance.

share|improve this question

Try something like this, this works for me.

enter image description here

share|improve this answer
-s "notepad C:\test.cmd" doesn't work for me. May be it's because of the Windows XP OS. – ccman May 14 '12 at 13:15

Ok windows is soooo funny ;) Im try this on Windows XP now..and You must do something like this:

echo foo > /home/mariusz/test/bar.txt
rdesktop -r disk:Q=/home/mariusz/test -s 'cmd /C "timeout /T 5 && notepad \\TSCLIENT\Q\bar.txt"'
share|improve this answer
This also doesn't work on my XP machine. I also tried -s 'cmd /C "notepad \\TSCLIENT\X\abcde.txt"'. BTW, timeout works on Windows 7, not on XP. – ccman May 14 '12 at 14:22
I made a bat file in Windows XP to emulate the time-out (based on pings). However you could try to open some existing file in your local partition, for example C. This should work. Then, if it works, you can try to do something more with remote storage. – us3r May 15 '12 at 10:18

You can try something like this:

rdesktop -u someuser -p somepass IP -r disk:X=/home/user/somedir_with_script/ \
-s X:\scriptname.cmd


rdesktop -u someuser -p somepass IP -r disk:X=/home/user/somedir_with_script/ \
-s "cmd \C X:\scriptname.cmd"
share|improve this answer
Thanks. I tried your examples with -s "notepad X:\myfile.txt" and -s "notepad" but notepad didn't start. – ccman May 14 '12 at 11:27

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.