Link to home
Start Free TrialLog in
Avatar of chuckp27
chuckp27

asked on

Autorun files on USB pen

Hi, I need to figure out how to autorun a file on a USB flash pen drive. Just like you can do with a CD - put it in and it starts running the program - I want to do with the pen drive. I've read that they're not the same and you can't do it. but there are companies who sell the pen drives with autorun software or something, they promote it. i've searched for a long time, can't find anything. maybe i can make the program - the powerpoint file for example - self-execute somehow? any help????? thanks.
ASKER CERTIFIED SOLUTION
Avatar of jayca
jayca

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ericsowa
ericsowa

1) Set either of these reg key values to dword 0x00000091 (windows xp default):

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\policies\Explorer
"NoDriveTypeAutoRun"=dword:00000091

HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\policies\Explorer
"NoDriveTypeAutoRun"=dword:00000091

Which one you use depends on if this behavior is just for your user account or for everyone on the machine.  LOGOFF/LOGON.

2) Insert the pen drive and open it in explorer.  Create a new text file.  Rename the text file "autorun.inf".  Type or paste something that looks like this:

[autorun]
shellexecute="Ismellapromotion.ppt"

Save.  Put Ismellapromotion.ppt in this folder as well (the drive root as it's sometimes called).  The next time you insert the drive powerpoint will start and open this file.

note: The shellexecute command only works on win2000 and above. In xp, if removable drives don't see autorun.inf, then it will bring up the autoplay selection menu.  Use the subst command (old msdos, works in xp :) ) to make a folder act like a drive on your system--great way to test autorun scenarios.  Example: SUBST F: C:\TEMP, and of course SUBST /? for more details.
If it apears as a drive (e: probably) It should be possible just put the autorun on it like you normaly would.
When you put it in does it ever say searching for auto run, does not find one and ask you what you want to do if it does it is 100% compatible with normal autoruns like the ones you have on CDs

If you dont know how to make an autorun either read about it under autoruns or get a program
I have used Typhoon Software auto run  which will put the stuff in a folder then you just copy it to your usb pen.

boot: start OS (no contents in RAM) from floppy, cd, hard disk, usb drive, network.
autoplay: start some program or open files when windows recognizes the presence of a device.
cofneverlivetotell, cofneverlivetotell it was not asked if you could boot from it.

ericsowa, i wish i had my flash drive with me right now to test that...
but im almost positive (and googled those keys as well)...those reg keys merely enable autoplay....on all the default devices XP already autoplays.
the problem is, XP doesn't autoplay flash drives... and good thing if you ask me! imagine the problems it could cause if you could go around to desktops plugging in your flash drive that autoplayed a virus!!

i'd image you could have a lot of fun at best buy or circuit city if that was the case! =)
Stop the presses.  I hope I haven't caused too many people to go stumbling around in the registry only to find that my suggestion doesn't work.  According to M$ ( http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/programmersguide/shell_basics/shell_basics_extending/autorun/autoplay_works.asp )  drives that report DRIVE_REMOVABLE to the shell don't support autorun.inf.  I thought that setting the registry value of NoDriveTypeAutoRun was supposed to overcome this.  I don't have a usb flash memory drive, so I took a memory stick and setup an autorun.inf and stuck it in the card reader.  No go.  I don't really see how preventing this helps the virus problem--all one has to do is insert the device and point and click if they really wanted to infect a machine.

My apologizes.  I assumed too much and made an ass out of me and me.
To test if it supports autoruns
Open notepad
Paste:

[autorun]
ICON=icon.ico

Save it as autorun.inf  save as file type: all files    and save it on the usb memory pen.

Open paint, make a small picture, about 30x30 pixels save it on the pen as icon.ico

Unplug the pen, wait for your computer to detect that it is gorn, put it back in.
If there is a icon for it that looks like the picture you saved on it as icon.ico it supports autoruns.

To make a autorun
http://www.typhoonsoftware.com/
download auto run
Use it, it will work.
Drive removable is reported so there is no autorun? It is not true I have a laptop, I can take the CD drive out easily and put my floppy disk or a battery in there. It is reported as drive removable, in safely remove hardware it is listed. It is a cd rom drive obbviously i have autoruns.
the difference is a cd-rom and floppy drive have auto-insert notification, and therefor autorun will work. usb flash drives are not currently supported by auto insert notification which is required to autorun
I think I deserve points.
I suggest how to find out if it supports it and how to make one easily.
adam1213, I do my best not to put down other experts contributions and to only help contribute to the author's question.

That being said, your answer is incorrect. I have owned a minimum of 6 different brand usb flash drives and none of them autorun. Nor do any of my co-worker's flash drives autorun.

Do you own a flash drive that autoruns? If  you do I'd really like to know about it because I have never seen one that does...and it's likely the author's is not either.

You cannot make a usb flash drive autorun without a third-party utility, sometimes this is included with the flash drive itself.
I did want to be fair, so I tried the specific program that was suggested on three different flash drives. While the icon *did* work, autorun did *not* work...on any drive.
If you tried my way of testing the icon was included, however there was no autorun in testing
There was an autorun but it was not in the test.

Try copying from a CD autorun.inf and the file that it opens (if you open autorun.inf in notepad and read it will refer to a file)


I do not have a flash drive
http://seclists.org/lists/fulldisclosure/2004/Jun/0631.html

FullDisclosure: USB risks - working autorun example (fwd from pen-test)

Okay, just to put this point at ease, autorun.inf usage on USB drives is
possible...............
Ctrl F  >And after some search ... autorun is possible on a usb storage device... as

>it explained just below ...


This will take you to the correct part
I don't know what you got from that website, but all I see there are two batch files. I re-read that artcile three times and followed all the links.

There is not one reference that I could find that shows you how to make your usb flash drive autorun (notice how many times they merely say usb storage device, not flash drive)

Those two batch files posted merely give some system information along with setting up a rouge account on your windows machine...can't say that seems safe to me.
I am objecting.

jayca's answer just says that you cant. The question is how to, not is it possable.
Now that I re-read the question further, the author *did* say he was looking for software that enabled him to autorun his flash drive. I think some of those software packages were presented.
http://www.udrw.com/en/product/

More than just a USB Flash Memory!

The UD-RW combines the flexibility of a USB Flash Drive and the benefit of a CD-ROM in one small compact package. The UD-RW's innovative Dual Zone Technology creates two drive icons automatically, a CD-ROM Drive (Read Only Zone) and a Removable Disk Drive (Flash Drive Zone), under 'My Computer'. It allows users to protect their precious data or files in the Read Only Zone while it still gives users the ability to modify the contents in the Flash Drive Zone.