Tuesday, June 15, 2010

RDP Automation in Ubuntu

  1. Open gnome-terminal from Applications,  Accessories, Terminal
  2. Create a text file in your home directory, example "auto_rdp.sh"
    cd ~
    nano auto_rdp.sh
  3. Copy and paste the following:
    #!/bin/bash
    echo 'Starting...' `date`
    rdesktop -u administrator -p your_password -s "cmd /k echo Hello World" & exit" 192.168.1.1
    echo 'Finished...' `date`
  4. Modify 192.168.1.1 to the name or IP of the machine to connect to
  5. Change username and password to match an account that resides on the Windows computer (Warning, it's stored in clear text, using administrator is not recommended)
  6. CTRL + X, Y, ENTER, ENTER to save
  7. Make file executable with this command:
    chmod +x auto_rdp.sh
  8. Install gnome-schedule from Ubuntu Software Center:  Applications, Ubuntu Software Center
  9. When prompted to enable universe repos, click Yes.
  10. Open gnome-schedule.
  11. Add ~ubuntu/auto_rdp.sh to command to run and set frequency to your liking (where ~ubuntu is your signon name.  Example: ~jsmith)
  12. Remote desktop will open automatically and perform the commands specified after cmd /k.  Don't forget to escape special characters with a backslash, for example, double quote is \", backslash is \\.
-Tres

12 comments:

明文吳 said...
This comment has been removed by a blog administrator.
原秋原秋 said...
This comment has been removed by a blog administrator.
Anonymous said...
This comment has been removed by a blog administrator.
Anonymous said...
This comment has been removed by a blog administrator.
Anonymous said...
This comment has been removed by a blog administrator.
Anonymous said...
This comment has been removed by a blog administrator.
Anonymous said...
This comment has been removed by a blog administrator.
Anonymous said...
This comment has been removed by a blog administrator.
Anonymous said...
This comment has been removed by a blog administrator.
Anonymous said...
This comment has been removed by a blog administrator.
Anonymous said...
This comment has been removed by a blog administrator.
Anonymous said...
This comment has been removed by a blog administrator.