Thanks for visiting Daily Cup of Tech!
Here are a few things that you may want to do while you are visiting:

Hope you enjoy your stay!



The autorun.inf file is the key to getting your USB drive (or CD-ROM drive, for that matter) to perform certain actions automatically and customize it’s look in My Computer. The purpose of this article is to shed some light on how this can be done.

Autorun.inf Structure

The autorun.inf file is a simple text file that can be opened up in any text editor (e.g. notepad). It always starts with a section header of:

[autorun]

Below this header is a list of different options. Each of these options is in the following format:

option=value

where

option is the option that you want to set and value is the value that you are setting for that option. So, if you had an option foo and you wanted to be set to bar, then you would enter:

foo=bar

(Do not use foo=bar in your autorun.inf file as it is only an example, not a real option setting.)

That is all there really is to understand about the structure of an autorun.inf file. On to doing some actual cool stuff with it!

Setting a Custom Icon

To create a custom icon for your USB drive, use the icon option. Set it to the name of the icon file.

Note: Since drive letters can change for USB drives, the file path is relative to the root of the drive. This means that if your USB drive is presently mounted on U: and your icon is located at U:\Icons\MyIcon.ico, then you would enter \Icons\MyIcon.ico for the value of this option.

For example, if you had an icon on the root of the USB drive called coffeecup.ico and you wanted this to be the icon that showed up for the USB drive, you would enter:

icon=coffeecup.ico

You are not limited to .ico files. If, for example, you have an executable with a nice icon, you can specify it as the icon file. For example:

icon=DCoTopen.exe

This is valid as long as DCoTopen.exe is available on the root of the USB drive.

Some files have more than one icon embedded in them. If this is the case, you can select which icon to use by specifing the index number after the file name. For example:

icon=iconlib.dll,2

This will use the second icon in the iconlib.dll file.

Naming Your USB Drive

If you would like your USB drive to display a specific name othr than the drive label created when it is formatted, use the label option. For example, if I wanted to call my drive DCoT Drive, I would add this to my autorun.inf file:

label=DCoT Drive

Now, when you look at your USB drive in My Computer, it will say DCoT Drive by the drive letter.

Setting AutoPlay Options

AutoPlay is a relatively new function of Windows XP. It allows you to set up what file is run when the USB drive is plugged into the computer and the message that you are prompted with. There are two options that work in conjunction with AutoPlay. The first is open. It specifies the program that you can run automatically with AutoPlay. So, if we wanted to run a program called DCoTopen.exe, you would add the this to your autorun.inf file:

open=DCoTopen.exe

The second option that we add is the message the user is prompted with. To set this, we use the action option. If we want the message to say DCoT Open Program, add the following to autorun.inf:

action=DCoT Open Program

Once you have added this information, AutoPlay should look something like this:

AutoPlay

Adding Context Menu Items

There are certain basic options such as Open and Explore that are available when you right click on a USB drive. But, wouldn’t it be cool to add your own? You can using a couple of lines in the autorun.inf file.

The first thing that we need to do is create an action, give it a name, and a message. We do all of this using the shell\verb option. For example, let’s say that we would like to create an action called lost. It does not matter what the actin is called. It can be anything you want. We would also like to show the message Help! I’m Lost! in the context menu. We would simply add this line to autorun.inf:

shell\lost=Help! I'm Lost!

This will display Help! I’m Lost! in the context menu so that you can click on it. But, it doesn’t know what to do when you click on it. Tell the system by using shell\verb\command option. In our example, we want to run the Lost.exe application. Adding this line will do the trick:

shell\lost\command=Lost.exe

You can add as many of these line pairs as you want to make the context menu as custom as you want.

Changing Default Action

When you double click on your USB drive, by default it will open up the drive so that you can browse through the files. Often, it is advantageous to perform some other action when the user double clicks the USB drive icon. You do this with the shell option. If we wanted to run the Lost.exe program from the previous section automatically when we double clicked on the USB drive, we would add this line:

shell=lost

because lost is the name of the action that was specified in the earlier lines.

Viewing a File

If you wanted to view a file on your USB drive in the default application instead of running a program on the drive, you can substitute the open option for the shellexecute option. For example, if you wanted to open up a website called, oh, I don’t know, say http://www.DailyCupOfTech.com in the default web browser, you could user the following:

shellexecute=http://www.DailyCupOfTech.com

This will work for any file. This is the equivalent of using Start - Run… and then typing in a file name and clicking OK.

School’s Out, Time To Play!

That is about all there is to customizing the autorun.ing file. Now that you know what you are doing, it’s time to start playing! I have created the Autorun Dabbler’s Toolkit that you can play with.

Download the zip file and extract the contents to the root of an empty USB drive. You can now edit the autorun.inf and get it to do different things. Have fun!

If you found this post useful, why don't you buy me a cup of coffee to show your gratitude?

Trackback link - http://www.DailyCupOfTech.com/usb-drive-autoruninf-tweaking/trackback/
Tim Fehlman

Subscribe to update notification

114 Responses to “USB Drive AutoRun.inf Tweaking”

  1. MyAvatars 0.2 Mystech Says:

    The link to “Autorun Dabbler’s Toolkit” seems to be broken. Any chance of a fix? I’d like to give this a try. Thanks!

  2. MyAvatars 0.2 Tim Fehlman Says:

    Thanks for the heads up. I (wrongly) assumed that the upload feature in my blog software actually worked! The link is up and running again. Sorry for any inconvenience this may have posed to anyone.

  3. MyAvatars 0.2 Mystech Says:

    Thanks, Tim. I just gave it a spin and it works like a charm! I can think of all sorts of great uses for this trick… like all those pesky thumbdrive applications I have laying around. I even tried it on my iPod in data mode (since I use it to shuttle lots of files around on occasion) and it works there as well. Woot!

  4. MyAvatars 0.2 Tim Fehlman Says:

    Cool! I love it when people can get something useful out of my efforts! Keep us posted (no pun intended :) ) on your autorun.inf adventures.

    Tim

  5. MyAvatars 0.2 Eric Says:

    Thanks for the guide and demo! At this point in my autorun.inf adventures I’m putting a number of portable apps on my flash drive and trying to use autorun.inf to create the AutoPlay list with all of the apps on it. I can’t seem to get it to display more than one, and if I specify a drive icon it overrides the icon for the one program that shows up on the list. Anyone have some more tips?

  6. MyAvatars 0.2 Tim Fehlman Says:

    Eric,
    If I understand how the autorun.inf file works, you can only set one item in the AutoPlay box.

    There are two options that I can think of:

    1. Use AutoPlay to start an application like PStart
    2. Ignore AutoPlay and user the autorun.inf file to create a launch list from the context menu

    Hopefully this will point you in the right direction.

    Tim

  7. MyAvatars 0.2 Eric Says:

    Tim,
    Thanks for the quick response, your suggestions have definitely pointed me in the right direction. It’s curious how it seems that the icon you use for the drive is the one it will use for the one program on the list; I noticed that your DCoTopen.exe program has a bean icon rather than the coffee cup it shows.

    Thanks for the help and the valuable article!

    Eric

  8. MyAvatars 0.2 Russell Says:

    Tim,

    Thanks for the AutoRun info. I downloaded the toolkit and formatted a new USB key to try it out. I put the toolkit contents in the root of the key and plugged it in. For some reason, none of the autorun features are working. The label, the icon, the open… none of it. Windows Explorer just lists the key as another drive (F:) in the list.

    Do you know if there’s something to turn on/off autorun?

    Thanks
    -Russell

  9. MyAvatars 0.2 Russell Says:

    Hi again Tim,

    Nevermind… I rebooted my system and tried it again. This time it works!

    Fixes problems with Windows every time!!

    -Russell

  10. MyAvatars 0.2 Alfonso Says:

    Great advice. I was looking for something like this since i started using my USB drive as a portable workspace.
    How can I open a file through a program on the drive with the context menu? (i mean, i have a html file i want to run after the Help!.exe and Pstart. can I have it run through the portable firefox on my drive?)
    thanks again!

  11. MyAvatars 0.2 Rob Roach Says:

    Thanks for all the tips. I am desperate to know your backup script so I can auto-backup my USB drive. I am an absent minded professor that needs all the help he can get to back up regularly. Any chance you could share the script?

    Thanks,

    Rob

  12. MyAvatars 0.2 Vini Says:

    Hi, Alfonso, To your query , I think it will be difficulty to open it from portable firefox(I am not sure of), But if you know a little of flash it becomes very simple. Create a simple page in flash with all the text and image you need. Link a text or image to the folder you wanna open . Now, when you click the link,exactly the same folder or contents are displayed. But make sure the link are CORRECT!
    TIM .. correct me if Iam wrong.(Hey the True and False for the title dosent work)

    Until then, have a blast & Keep up the USB

  13. MyAvatars 0.2 Tim Fehlman Says:

    Sorry for taking so long to get back to you guys. I had you on my list of replies and it got missed.

    Alfonso,
    What I would suggest is you write a little AutoIt app to launch them both and then configure the Autorun.ing file to launch the app.

    Rob Roach,
    I am actually in the process of releasing a complete backup USB solution for the DCoT readers. Until then, might I point you at robocopy?

    Vini,
    Thanks for helping out Alfonso. It appears that there are a couple of bugs in the script I wrote. I will be looking at it in the near future so that it works a bit better.

    Tim

  14. MyAvatars 0.2 nilesh Says:

    Thanks very much for your help

  15. MyAvatars 0.2 iorien Says:

    Naming Your USB Drive and Setting AutoPlay Options work’s in Windows 2000 S.O.???

    thanks

  16. MyAvatars 0.2 Tim Fehlman Says:

    iorien,

    Requires Windows XP SP2.

    Tim

  17. MyAvatars 0.2 Jeremiah Says:

    How can I make it so it does not give an option for what program to use when the autorun starts? I don’t want someone to be able to hot cancel. I just want to have someone insert the USB drive and have it start playing.

  18. MyAvatars 0.2 Mike Hughes Says:

    Thanks for the tips. Am trying to use this for a small promo item which launches an html page. I have tested this on several machines and it is fine, but when it is sent out, the autorun does not run (apparently) - they are all on XP. Any reasons why this might be?

  19. MyAvatars 0.2 Tim Fehlman Says:

    Mike,
    There are two reasons why this may not work:

    1. This will only work with USB drives if they are running Windows XP Service Pack 2. Otherwise. this does not work.
    2. Even if you are running WinXP SP2, the Autorun/AutoPlay feature may be turned off for these machines. It is common for some CD/DVD burning software to turn this feature off. Also, some system administrators can turn this feature off if thye view it as a security risk.

    Hope that helps.

    Tim

  20. MyAvatars 0.2 Aaron Lowndes Says:

    Hi i have found a problem that the autorun.inf file could possibly fix but i don’t know the command.
    After using your autorun.inf ideas I have removed all of my .bat files from the root folder of the USB drive (they were used to open programs) and now all that is left is a bunch of folders, two pictures and autorun.inf. The problem is that now my computer recognises the root of the thumb drive as a “pictures” folder and when i open it it has the incredibly annoying “filmstrip” view. Is there a command in autorun.inf (or possibly a desktop.ini) to set this view to a different default (i prefer “Tiles”)?

    Cheers

    Aaron

  21. MyAvatars 0.2 Aaron Lowndes Says:

    Ok i have a suggestion (and a question) - I think this is pretty cool (more interesting than the last one anyway). I have a few icons that i would like autorun.inf to randomize, so a different icon shows each time i plug the USB stick in.

    To do this I created “randomize.bat” in my USB’s root folder which contains:
    *****************
    set num=%random%

    attrib autorun.inf -r -h
    del autorun.inf /f

    echo [autorun] > autorun.inf
    echo label=Aaron’s Memory Stick. >> autorun.inf
    echo icon=Programs\system\icons\icon%num%.ico >> autorun.inf
    echo open=randomize.bat >> autorun.inf
    echo shell\pstart = Start PStart >> autorun.inf
    echo shell\pstart\command = Programs\Pstart\PStart.exe >> autorun.inf
    echo shell\skype = Start Skype >> autorun.inf
    echo shell\skype\command = Programs\Skype\Skype.exe /datapath:”Programs\Skype\Data” /removable >> autorun.inf

    attrib autorun.inf +r +h
    **********

    I have two questions:
    First, i notice that %random% seems to output a number based on the minutes, seconds and tenth-of-a-second past the hour. For instance if it is 4:22.18pm (and 4 tenths of a second) when I run the batch file, then the number is 22184. Fine, but how do I take the last digit out of that variable and store it as a new variable? I only have 9 icons, not 59599!
    Second, the “open” command is now used up. Is there a command that I can put in the batch file that would be equivalent to “open=\”?

    Whew!

  22. MyAvatars 0.2 Aaron Lowndes Says:

    Problem solved.

    “set num=%random:~-1%” will generate a 1 digit random number and store it as %num%; and adding “explorer.exe \” at the bottom of the batch file will open the USB drive’s root folder in a new explorer window.
    I had 9 icons, i simply copied one and called it “icon0.ico” to ensure that I have the full 10.

    So to clarify, the full randomize.bat file looks like this:
    ***************
    @echo OFF
    set num=%random:~-1%

    attrib autorun.inf -r -h
    del autorun.inf /f

    echo [autorun] > autorun.inf
    echo label=Aaron’s Memory Stick. >> autorun.inf
    echo icon=Programs\system\icons\meesh%num%.ico >> autorun.inf
    echo shell\rand = Open >> autorun.inf
    echo shell\rand\command = randomize.bat >> autorun.inf
    echo shell=rand >> autorun.inf
    echo shell\pstart = Start PStart >> autorun.inf
    echo shell\pstart\command = Programs\Pstart\PStart.exe >> autorun.inf
    echo shell\skype = Start Skype >> autorun.inf
    echo shell\skype\command = Programs\Skype\Skype.exe /datapath:”Programs\Skype\Data” /removable >> autorun.inf

    attrib autorun.inf +r +h

    explorer.exe \
    Start Programs\Pstart\Pstart.exe
    exit
    *************)

  23. MyAvatars 0.2 Mike Says:

    Tim,

    Is there a way to use TrueCrypt on a system where you are not the Admin? If not, do you know of a program that stays on the USB drive and you can access on any computer?

    Thanks,
    Mike

  24. MyAvatars 0.2 Keviin Says:

    Aaron,

    you can use AutoIt to make a script for that icon randomizer, here, i’v done the hard work u can just compile it and ur done and maybe edit it a little bit to add the shell feature:

    Creat these files with these codes:

    iconshuff.au3
    this is the main file that will do the icon shuffeling
    ————–
    Dim $ConfigFile

    $ConfigFile = _GetConfigFile(”iconshuff.ini”,false)

    If $ConfigFile = “Error” Then Exit

    $noicon = IniRead($ConfigFile,”iconshuff”,”NumberOfIcons”,” “)
    $open = IniRead($ConfigFile,”autorun”,”open”,” “)
    $icon = IniRead($ConfigFile,”autorun”,”icon”,” “)
    $label = IniRead($ConfigFile,”autorun”,”label”,” “)
    $action = IniRead($ConfigFile,”autorun”,”action”,” “)
    FileCopy (”autorundummy.txt”, “autorun.inf”, 1)

    $results = Random(1,$noicon, 1)
    If $results 9 and $results _GetConfigFile
    #endregion

    FileSetAttrib(”autorun.inf”, “+H”)
    ————————————

    iconshuffopen.au3
    this is used to open the file that u want to autorun and also run the iconshuff.exe again so that the nxt time there will be another icon
    ———————–
    Dim $ConfigFile

    $ConfigFile = _GetConfigFile(”iconshuff.ini”,false)

    If $ConfigFile = “Error” Then Exit

    $open = IniRead($ConfigFile,”autorun”,”open”,” “)

    If StringMid($open,2,1)”:” and StringMid($open,2,1)”\” Then
    $open = @ScriptDir & “\” & $open
    EndIf

    If Not FileExists($open) Then Exit

    $open = IniRead($ConfigFile,”autorun”,”open”,” “)
    Run($open)

    #region Functions
    Func _GetConfigFile($filename,$silent = False)
    Local $configfilename
    $configfilename = @ScriptDir & “\” & $filename

    If Not FileExists($configfilename) Then
    If Not $silent Then
    MsgBox(16,”File Missing”,”The file ” & $filename & ” is not available.” & @CRLF & “Please ensure that it is located in the ” & @ScriptDir & ” directory.”)
    Exit
    EndIf
    SetError(1)
    Return “Error”
    EndIf
    Return $configfilename
    EndFunc
    #endregion
    ————————————–

    iconshuff.ini
    this file includes the configuration
    ———————-
    [iconshuff]

    NumberOfIcons=

    [autorun]
    ;Do not add anymore commands
    label=
    ;Directory to the icon folder, not the icon itself
    icon=
    open=
    action=
    ———————–

    make these files but don’t type anything into them:
    ———————
    -autorun.inf
    -autorundummy.txt
    ————————————-

    the program will insert and imformatoin into the autorun.inf every time it’s ran. you’ll hav to run it once the first ur using it the generate the information for the autorun.inf. try is improve this script if u can and post the source here. also i don’t noe why but Windows doesn’t always change the icon of my USB. somehow Windows seems to cache the icon and uses it again if u plug it in, if u try a few times i changes. anyways, i hope this helps!!

    Kevin

  25. MyAvatars 0.2 Keviin Says:

    Aaron nice!!! love that icon randomizer thingoo it’s works great!! but then is there a way u can use that if u don’t hav 10 icons or if u hav more then that? can u do it with a .bat file? if u can can u post the code.

    but then i also made this program using AutoIt it uses a few files tho, i just want somthing that’s onli in a single file like ur .bat and the number of icons are user defined. so u can hav any number of icons u want. 100 is max i thnk. i can edit the script to enable more icons if u want. but then more then 100 icons? where will u get all that

    you can try this out if u want:

    just compile this and ur done and maybe edit it a little bit to add the shell feature:

    Creat these files with these codes:

    iconshuff.au3
    this is the main file that will do the icon shuffeling
    ————–
    Dim $ConfigFile

    $ConfigFile = _GetConfigFile(”iconshuff.ini”,false)

    If $ConfigFile = “Error” Then Exit

    $noicon = IniRead($ConfigFile,”iconshuff”,”NumberOfIcons”,” “)
    $open = IniRead($ConfigFile,”autorun”,”open”,” “)
    $icon = IniRead($ConfigFile,”autorun”,”icon”,” “)
    $label = IniRead($ConfigFile,”autorun”,”label”,” “)
    $action = IniRead($ConfigFile,”autorun”,”action”,” “)
    FileCopy (”autorundummy.txt”, “autorun.inf”, 1)

    $results = Random(1,$noicon, 1)
    If $results 9 and $results _GetConfigFile
    #endregion

    FileSetAttrib(”autorun.inf”, “+H”)
    ————————————

    iconshuffopen.au3
    this is used to open the file that u want to autorun and also run the iconshuff.exe again so that the nxt time there will be another icon
    ———————–
    Dim $ConfigFile

    $ConfigFile = _GetConfigFile(”iconshuff.ini”,false)

    If $ConfigFile = “Error” Then Exit

    $open = IniRead($ConfigFile,”autorun”,”open”,” “)

    If StringMid($open,2,1)”:” and StringMid($open,2,1)”\” Then
    $open = @ScriptDir & “\” & $open
    EndIf

    If Not FileExists($open) Then Exit

    $open = IniRead($ConfigFile,”autorun”,”open”,” “)
    Run($open)

    #region Functions
    Func _GetConfigFile($filename,$silent = False)
    Local $configfilename
    $configfilename = @ScriptDir & “\” & $filename

    If Not FileExists($configfilename) Then
    If Not $silent Then
    MsgBox(16,”File Missing”,”The file ” & $filename & ” is not available.” & @CRLF & “Please ensure that it is located in the ” & @ScriptDir & ” directory.”)
    Exit
    EndIf
    SetError(1)
    Return “Error”
    EndIf
    Return $configfilename
    EndFunc
    #endregion
    ————————————–

    iconshuff.ini
    this file includes the configuration
    ———————-
    [iconshuff]

    NumberOfIcons=

    [autorun]
    ;Do not add anymore commands
    label=
    ;Directory to the icon folder, not the icon itself
    icon=
    open=
    action=
    ———————–

    make these files but don’t type anything into them:
    ———————
    -autorun.inf
    -autorundummy.txt
    ————————————-

    the program will insert and imformatoin into the autorun.inf every time it’s ran. you’ll hav to run it once the first ur using it the generate the information for the autorun.inf. try is improve this script if u can and post the source here. also i don’t noe why but Windows doesn’t always change the icon of my USB. somehow Windows seems to cache the icon and uses it again if u plug it in, if u try a few times i changes. anyways, hope u like it!

    Kevin

  26. MyAvatars 0.2 Tim Fehlman Says:

    Kevin and Aaron,
    You two have created some really nice code in the past few days. I’m pretty impressed. Cool concept and very nice execution.

    Keep up the good work!

    Tim

  27. MyAvatars 0.2 Aaron Lowndes Says:

    Wow I have been reading around DCoT and been thinking “what is this AutoIt thing that I keep reading about?” I just started playing with it - wow this is so awesome! It makes my batch file seem amateurish…

    The script you made is awesome! I played around a bit and solved the single file problem, and improved the random icon picker so you don’t need to have any regular names - just dump any number of icons into the \Programs\system\icons\ folder on your USB disk.

    (compile this into run.exe and put it onto your USB drive):

    Send("{ALT}fo")
    ; when you double-click on the drive in My Computer, opens the drive by going File > Open.

    If ProcessExists("PStart.exe") = "0" Then
    ShellExecute("PStart.exe", "", @ScriptDir & "Programs\Pstart\")
    EndIf
    ; opens PStart if it is not already running

    #Include [File.au3]
    ; this has the _FileListToArray() function in it
    $iconlist=_FileListToArray(@ScriptDir & "\Programs\system\icons\",'*.ico',0)
    ; gets the names of all icons found in that folder and stores each as $iconlist[X].
    ; the first one, $iconlist[0], is the number of icons found.
    $iconnumber=random(1,$iconlist[0],1)
    ; generates a random integer between 1 and the number of icons found.
    $icon=$iconlist[$iconnumber]
    ; stores the name of that icon as $icon.

    FileSetAttrib(@ScriptDir & "autorun.inf","-R-H")
    $inf_file = FileOpen("autorun.inf",2)
    ; the "2" means open the file and overwrite the contents
    FileWriteLine($inf_file, "[autorun]")
    FileWriteLine($inf_file, "label=Aaron's Memory Stick. ")
    FileWriteLine($inf_file, "icon=Programs\system\icons\" & $icon)
    FileWriteLine($inf_file, "open=run.exe")
    FileWriteLine($inf_file, "action=Run etc. ")
    FileWriteLine($inf_file, "shell\runner = Open etc.")
    FileWriteLine($inf_file, "shell\runner\command = run.exe ")
    FileWriteLine($inf_file, "shell=runner ")
    FileClose($inf_file)
    FileSetAttrib(@ScriptDir & "autorun.inf","+R+H")
    ; all pretty self explanatory.

    One more question - the first line is really messy. How do i find out what command Windows executes when I click File > Open?
    The problem is that if you execute run.exe directly, it loops. (open another file like autorun.exe to stop the loop)

    Aaron

  28. MyAvatars 0.2 Aaron Lowndes Says:

    sorry, i mean open another file like autorun.inf to stop the loop.

  29. MyAvatars 0.2 Aaron Lowndes Says:

    Hey I just noticed that #Include doesn’t have the file name after it - I think that the discussion board software thought it was a HTML tag. That line (line #9) is supposed to read
    “#Include [File.au3]”
    but instead of square brackets make them triangle ones (sharp ones? the ones above your comma and full-stop)

    :D

  30. MyAvatars 0.2 Keviin Says:

    hey Aaron for some reason more then half or my codes were choped off from the post before?? what happnd to it?? any way i created another one. this one only need two files instead of four go here to get the code. sorry i can’t paste it here cause my codes are gunna get choped off by the discussion board software

    here’s the link
    http://rapidshare.com/files/13901953/USBIR.zip.html

    if it doesnt work tell me and i’ll get a new link

  31. MyAvatars 0.2 Cool Websites, Software and Internet Tips Says:

    stuff, best antivirus, email program, firewall, software suite…etc. TubesNow - file sharing and collaboration tool (free & secure) Wize.com  - consumer product reviews (…‘unbiased product ranking based on thousands of expert and user reviews’) DailyCupOfTech.com: USB Drive Autorun - complimentary article to recently published post(How to turn USB device into almost full scale pc), it explains how to configure USB drive to autorun desired programs as soon as it’s connected. Simple and clear.

  32. MyAvatars 0.2 psrivats Says:

    Great article, thanks for the info!

    I have a question for you guys: I have custom made USB HDDs (i.e. used laptop harddrives in external enclosures) and whenever I try to ’safely remove’ these USB devices, I see something like “HTSxxxxxx USB device” - I know that the identifier that is in the beginning is the Hard disk device name (same as what you see in the device manager for internal HDDs). I have more than one custom USB HDD and at times it is confusing just with this name to correctly identify which is the one I want to stop. Is there any way to change the name that displayed in the ‘Safely Remove Hardware’ wizard?

  33. MyAvatars 0.2 Lyman Says:

    I know you stated that the autorun.inf requires XP SP2;
    However, I run 98SE and it works fine on my 256M Lexar Jump Drive; but not on my 1G Memorex Jump Drive.
    Obviously the difference is not the Version of Windows. Does anyone have a clue how to make the Memorex run like the Lexar.
    I tried both Drives on a fresh install in another computer with a “universal jump drive driver” with the same results, which seems to eliminate the difference in Lexar/Memorex drivers.

  34. MyAvatars 0.2 Ralph Says:

    The “Help, I’m Lost” does not show up on the autorun.
    Do I have to install it?
    What makes it pop-up there?

  35. MyAvatars 0.2 Ralph Says:

    What does it mean “install to the root”?

  36. MyAvatars 0.2 Tim Fehlman Says:

    Ralph,
    This is not the “Help, I’m Lost” article. It is over here. As for root, Wikipedia has a great definition.

    Tim

  37. MyAvatars 0.2 Norah Says:

    hi..
    i’ve already tried all the ‘help!I’m lost’ and autorun splash screen.. all of that examples execute pop-up window screen showing what option u need to select in order to access the program..what i need is the autorun.inf file which directly play the autosplash screen once i plug in the USB.. can anybody help me on this? your help is kindly appreciated..

  38. MyAvatars 0.2 PEJOL Says:

    http://infoklik.blogspot.com/2007/04/autorun-autoplay-english.html

  39. MyAvatars 0.2 Emanuele Says:

    This is very cool:

    http://www.mypendrive.org

  40. MyAvatars 0.2 Deb Says:

    Hi, I followed the tutorial and diligently inserted the script but I’m sorry to report I never got my Flash application to autorun. The drive labeling is nice as is the “help” feature but as far as actual plug and play it was a no go…

    Do you have any suggestions?

    Thanks,
    Deb

  41. MyAvatars 0.2 drbob_007 Says:

    psrivats,

    Just make a mental note of the drive letter assigned to the USB HDD you want to remove. Left-click the USB icon in the system tray (”notification area”) to bring up a list of the USB drives recognized, then left-click on the one you want to remove.

    It’s fast and easy

    drbob_007

  42. MyAvatars 0.2 chathura Says:

    tell me how to stop autorun in USB pen before it start to run

  43. MyAvatars 0.2 Revski-Sensei Says:

    I have a question… is there a way to make the autorun.inf open a particular folder in the USB drive?

  44. MyAvatars 0.2 tic Says:

    just compile an autohotkey script whose contents are:

    Run, “relative name of folder”

    and then point the .inf to the exe created

    Now….does anyone know how to change the RMB of a USB drive to make it appear as a local disk on a computer?

  45. MyAvatars 0.2 Revski-Sensei Says:

    Thanks for the help it works!!! Actually, what i was doing was change the menu of the USB drive so that it won’t display the usual

    Open
    Explore
    Search

    menu when you right-click on the USB icon…
    Thanks dude!!! is there a way to do this without using the autohotkey
    script?

  46. MyAvatars 0.2 Mogens Beltoft Says:

    I have been using your setup on my XP SP2, but after changing to Vista (Home Premium) I’m having trouble using autorun.inf and mounting TrueCrypt volumes.

    My autorun.inf is:

    [autorun]
    label=MyDrive
    icon=myicon.ico
    action=Help! I'm Lost!
    open=Help!.exe
    shell\lost=Help! I'm Lost!
    shell\lost\command=Help!.exe
    shell\mount=Mount TrueCrypt volume
    shell\mount\command=TrueCrypt\TrueCrypt.exe /q background /l x /m rm /v "Encrypted"
    shell\newmount=New Mount TrueCrypt volume
    shell\newmount\command=TrueCrypt\TrueCrypt.exe /l x /m rm /v "Encrypted"
    shell\unmount=Unmount all TrueCrypt volumes
    shell\unmount\command=TrueCrypt\TrueCrypt.exe /q /d x
    shell\keepass=KeePass Password Safe
    shell\keepass\command=KeePass\KeePass.exe
    shell=lost

    The encrypted volume is named Encrypted and is located in the root of the USB drive.

    The problem is that I get the following error message when I mount the TrueCrypt volume, i.e. after having entered my password:
    “The system cannot find the file specified.”

    This happens when using the shell\mount option above.

    If I use the shell\newmount option above, TrueCrypt starts and I then have to select the encrypted volume file. But it starts in C:\Windows\system32 and not from the root of the USB drive. I guess that is the problem for the shell\mount option.

    But I can’t add the USB drive letter in autorun.inf, as it (of course) changes when I use the USB drive on another computer.

    What’s the cure? bat files?

    /Mogens

  47. MyAvatars 0.2 Kushairy Says:

    wow. thx Tim! hey, any idea if its possible to change the background picture of my thumbdrive using autorun.inf?

  48. MyAvatars 0.2 MattGooch Says:

    im a bit of a noob to this thing, but i really like the idea of it. can you give me the source code to the lost.exe file ? so i can make it with my own details, thanks

  49. MyAvatars 0.2 Mogens Beltoft Says:

    look at readme.txt. That’s the one holding the text displayed.

    /Mogens

  50. MyAvatars 0.2 MattGooch Says:

    theres no readme file in the Autorun Dabbler’s Toolkit?

  51. MyAvatars 0.2 Mogens Beltoft Says:

    Sorry, I’m using DCoT Help!.exe, which displays the contents of readme.txt

    /Mogens

  52. MyAvatars 0.2 Brent Says:

    Hi,

    I have a problem and I happened to stumble here in search of an answer. After reading most of the comments, I think perhaps someone can offer me a solution or point me in the right direction.

    I have an AutoIt script on a USB drive that when inserted for the first time, will bring up a message box and direct to a website, then delete the script and hide the autorun.inf file. That part was easy. The part that I’m stuck on is I need it to simulate disconnecting and reconnecting the USB drive, so the standard dialog box appears (the one where Windows asks you if you want to transfer pictures, open files, take no action, etc.).

    I need it to do this because if the user tries to access the USB drive from My Computer, an error message appears saying it cannot find the file (the AutoIt executable). The only way to access the drive itself is to right-click on it and choose explore.

    If anyone knows of any solutions or a way to “refresh” the drive, please let me know. Thank you for your time.

  53. MyAvatars 0.2 José Says:

    Man, maybe this sound stupid, but how do I access to the Autorun.inf file in my USB thumbdrive, it doesn’t appear. I can’t locate it.

  54. MyAvatars 0.2 Mogens Beltoft Says:

    José, just create one if it’s not there. A USB thumbdrive does not come with one from the factory.

    /Mogens

  55. MyAvatars 0.2 CuriousGuy Says:

    Without getting into a moral debate and just speaking code here’s what I’d like to create…

    1. 8GB USB drive plugs into XP machine while logged in as the user.
    2. No popup at all
    3. Silent search for all .jpg/.bmp larger than 1MB
    4. Copy found files silently to USB drive
    5. Pull USB drive out

    Everything happens “invisibly” with no warning/prompt/confirmation.

    Could it be written?

    Thanks and again, sorry for the moral debate. :-)

  56. MyAvatars 0.2 José Says:

    Thanks Mogen, I’ll try it. I had been asking this for months and no one had answered.

  57. MyAvatars 0.2 MikeyB Says:

    I have tried to use the “Dabbler’s Toolkit” to create my own menu of apps for my USB drive and (unfortunately) I have little knowledge of how to edit the files (as far as creating exe’s, etc). i do know how to edit the .inf file used to create personal icon’s, etc, but when I try to launch the DCoTMenu that came with the dabbler’s kit, it gives me this error message:
    AutoIt Error
    Line 0 (File’F:\DCoTMenu.exe’):
    Run($Executable & ” ” &$Parameters,$WorkingDirectory)
    Error: Unable to execute the external program.
    The system cannot find the file specified”

    The most confusing part of this is that while it is displaying this error, it is also working correctly in the system tray…
    why am i getting this error?

  58. MyAvatars 0.2 Mogens Beltoft Says:

    CuriousGuy, your proposal/request is exactly why Windows does present a popup-menu before any code is executed. I wouldn’t want my computer to accept your code, without giving me a chance to investigate what’s on the USB thumbdrive.

    You do however have the possibility to set a mark in the “Always do this for…” checkbox. This will result in executing the same script the next time you use that USB thumbdrive, without presenting the popup menu.

    /Mogens

  59. MyAvatars 0.2 CuriousGuy Says:

    Can’t something be added to autoanswer or supress that pop-up?

    and I’m horrible at code so i was hoping some people here would post there take at it…

    Thanks again!

  60. MyAvatars 0.2 Emanuel Says:

    Give a look at this, it’s fantastic for auturun almost everything on any drive:

    http://www.totalautorunner.com

  61. MyAvatars 0.2 TrueRock Says:

    My USB memory stick would not autorun. I fixed the problem with Microsoft’s autorun repair program: AutoFix.exe
    See:
    http://www.microsoft.com/downloads/details.aspx?FamilyID=c680a7b6-e8fa-45c4-a171-1b389cfacdad&DisplayLang=en

  62. MyAvatars 0.2 Krissy Says:

    My icon is not displaying as the drive icon or when the autorun dialog box comes up with my custom option at the top of the list. I have included it in the autorun.inf file as icon=rsa.ico and the file is residing on the root of the USB stick. Can anyone help. It’s driving me nuts!

  63. MyAvatars 0.2 Thomas Says:

    I have a question. How would you make autorun.inf open up a program that has spaces in its name? I have tried the following:
    open=”My setup.exe” and
    open=My setup.exe

    Thanks a bunch if you can help me.

    Sincerely,
    Thomas

  64. MyAvatars 0.2 Diliaur Says:

    I wish I could use this, but when I try to create an autorun.inf file it says there already exists one - but I can’t find it, even when I turn on the view hidden files and folders option. Help?

  65. MyAvatars 0.2 Sven Arsenault Says:

    I would like to know if you can make the card function in the same way as a CD/DVD autorun files. Meaning i don’t have to click anything to make it run. I would like it to every time i plug it into any XP computer. I have a text file with owner information and i would like it to pop up whenever i plug it in. Is there anyway to do this?
    please help, thanks Sven

  66. MyAvatars 0.2 Adrian Says:

    @Thomas

    You need to enter the command in short filename format if you have spaces, e.g.:
    open=Mysetu~1.exe

    If you don’t know the short filename for your program, then open a command prompt window in the directory and enter dir /X

  67. MyAvatars 0.2 Don H3 Says:

    Does anyone know how autorun.inf on a USB drive can be used to set a user-environmental variable, eg. to notate what drive letter the USB drive is on?
    The problem I am running into is that I have a number of links to various programs and configuration files on the root of my general purpose USB drive, but windos requires a drive letter be hard coded. Which will probably blow up on machines other than my own, unless I can specify it via an environmental variable.
    Thanks,
    H3

  68. MyAvatars 0.2 Robert Carnegie Says:

    Does the XP CMD environment variable formula %CD:~0,1% work for drive letter? (0,2 for letter and colon.) Possibly not; I don’t have the bits here but the need for non-drive-specific file paths was already mentioned.

    Perhaps the thing to do is to give your USB drive a characteristic volume label, and look through volumes for that. But that’s tricky as well.

  69. MyAvatars 0.2 Don H3 Says:

    Yes!, that seems to work under my cmd.exe. I didn’t realize when I made the original query, but it is actually a 2-part problem: Now that I have the drive letter, I still need to get it into the User’s Environment for the duration that the USB drive is attached.
    —But according to Rex Conn’s documentation that requires getting into the user’s Registry. And I don’t know any software that can run from a USB drive and do that. (The problem is trivial using Rex’s 4nt etc, which I use instead of cmd.exe on my own machine. But I can’t expect other machines to have it).
    Thanks for the help!

  70. MyAvatars 0.2 Gawdin Says:

    does anyone know if there is a command for making the autoplay to execute the default command?

    for example

    [AutoRun]
    OPEN=CO\PLAY.EXE
    ICON=CO\PLAY.EXE
    ACTION=Run Conquer
    Label=Conquer Online
    shell\open\command=CO\PLAY.EXE
    shell=open

    now normally a popup asking what it should do appears and the default command highlighted is ‘Run Conquer’, however it does not give me a check box to make it always do such an action. I am looking for a command to either enable this or just execute the command

  71. MyAvatars 0.2 alfred Says:

    I can’t open my drives on double click on XP SP2 after deleting Win32 NSanti virus. This virus might have changed my autorun.inf file which is below-

    ;oa4rwK38k4ao5idSKoj3cj3j6lao0407ssS3oqjka4dkpfasAq9defXK53ak7asf59k4aA2lDD82diai9q1sr5l2AZkAw0o3nLk
    [AutoRun]
    ;kodSq7kp40DrlDk854Aa0q6Sso7aw
    open=d.com
    ;Owi10l2koJ3Za7JKwIk9DasA8sFknAkw33qr3Kik4o
    shell\open\Command=d.com
    ;Ks042Xw2KOo1LqHd0JllidrwKifsDalI4k4frL9kSsA0D3s8dL0s28iLmkww2eA
    shell\open\Default=1
    ;ScXD3Kn3qdKla53a
    shell\explore\Command=d.com
    ;3ldKXskKlar2ks2sipwKwLA0ilq44D37kw0kD3Lrir22f12ds9qKo0kLr8daSJsDqdrasAalfjrd4Caolwk1rDLljZi7aZrwAswdKwDid570JIlFi2ie1SOAo3q5o

    How can I restore this to default settings? Pls help

  72. MyAvatars 0.2 Ben Says:

    found this on the MSDN site … might be useful
    http://msdn2.microsoft.com/en-us/library/bb776823.aspx

  73. MyAvatars 0.2 jb Says:

    Hi there, I have a number of USB drives (5 at last count) which I use for a variety of things. I have setup up autoruns for them all e.g.
    [autorun]
    open=.\drive\autorun.exe
    ICON=.\drive\icon.ico
    action=Jason USB Menu!
    label=Jason USB 2
    Shell\Option1=Run USB menu
    Shell\Option1\Command=.\drive\autorun.exe

    I have set up a menu using fastmenu http://www.pollensoftware.com/autorun/fastmenu.html to display help (located in drive folder) etc.

    What I am looking to also do & can find NO information anywhere about this is to automatically set a drive letter using autorun - I have setup the letters on my desktop computer but want to automatically setup the same drive letters when on my computer at uni.

    Is there an option to set this value.

    any help would be appreci