Results 1 to 8 of 8

Thread: USB Autorun?

  1. #1
    Join Date
    Feb 2008
    Location
    Toronto, ON, CA
    Beans
    405
    Distro
    Ubuntu 10.10 Maverick Meerkat

    USB Autorun?

    Hello all!

    So, I was wondering about autorun and USB drives.
    Is there a way to run some sort of script from the USB drive when it is inserted?

    What I am wanting to do is add this to an external drive that has all my movies. My intent is to run a portable version of XBMC Media Centre when the USB is inserted into the computer.
    Its easy to do for windows, but I can't find the method for Linux/Ubuntu.

    Any help would be wonderfunk!
    Drewsus

    ps- I would like to not have to modify the system, only the USB, if possible.

  2. #2
    Join Date
    Feb 2008
    Location
    Toronto, ON, CA
    Beans
    405
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: USB Autorun?

    bump for the evening crowd...

  3. #3
    Join Date
    Mar 2010
    Beans
    Hidden!

    Re: USB Autorun?

    hi!

    so you need to make a executable text file (with gedit and chmod +x)

    here's a simple one i use(it lives on the usb drive and works with windows)


    [autorun]
    icon=Icon.ico


    this calls up a picture (icon.ico) which is show on the desktop for the folder.

    good luck!

  4. #4
    Join Date
    Feb 2008
    Location
    Toronto, ON, CA
    Beans
    405
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: USB Autorun?

    does it have to be named something specific like for Windows it would be autorun.inf (iirc)?

    edit: I must have missed where you said this works for windows...
    Thanks anyway

    So is there a solution to this for Linux?
    Last edited by drewsus; May 18th, 2010 at 04:36 AM.

  5. #5
    Join Date
    Mar 2010
    Beans
    Hidden!

    Re: USB Autorun?

    yea, this works for linux and windows

    so i guess you could mess about and try to get other commands to run..

    i thing all you need is
    [autorun]

    the any command you want,
    just make sure it's on the first level of the usb stick

  6. #6
    Join Date
    Aug 2007
    Beans
    65
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: USB Autorun?

    Hm... this didn't work for me with the instructions you gave, but it does if you name the file autorun and construct it as a typical shell script. For instance, if the contents of autorun are
    Code:
    #!/bin/bash
    gcalctool
    when you insert the drive you get asked (twice) whether you want to run that, and then it starts the Calculator.

  7. #7
    Join Date
    Apr 2008
    Beans
    44
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: USB Autorun?

    did anyone get anywhere with this?

  8. #8
    Join Date
    Feb 2008
    Location
    Toronto, ON, CA
    Beans
    405
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: USB Autorun?

    Quote Originally Posted by davavanstone View Post
    did anyone get anywhere with this?
    Yes, precisely as Jim Danner says above!
    Works like a charm.
    I will make this as solved now, as I should have before.

    Drew
    ps- Thanks Dannerman

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •