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

16 comments:

明文吳 said...
This comment has been removed by a blog administrator.
原秋原秋 said...
This comment has been removed by a blog administrator.
江婷 said...
This comment has been removed by a blog administrator.
法邦法邦 said...
This comment has been removed by a blog administrator.
吳婷婷 said...
This comment has been removed by a blog administrator.
姿柯瑩柯dgdd憶曾g智曾 said...
This comment has been removed by a blog administrator.
吳婷婷 said...
This comment has been removed by a blog administrator.
偉倫s倪陳合恭陳陳sgdgd陳 said...
This comment has been removed by a blog administrator.
楊儀卉 said...
This comment has been removed by a blog administrator.
蔡舜娟蔡舜娟 said...
This comment has been removed by a blog administrator.
家榮家榮 said...
This comment has been removed by a blog administrator.
佳瑩佳瑩 said...
This comment has been removed by a blog administrator.
柏陳勳 said...

愛情是盲目的,但婚姻恢復了它的視力。 .......... . . . ............. .......... ..........

恩宛玲如 said...

活是一種鍛鍊靈魂的東西..................................................................

家唐銘 said...

Knowledge is a treasure, but practice is the key to it.................................................

偉曹琬 said...

困難的背後,隱藏著通往成功的階梯............................................................