Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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
add comment

3 Answers

You can try something like this:

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

or

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
add comment

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
add comment

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 192.168.85.160 -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
add comment

Your Answer

 
discard

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.