PDA

View Full Version : Autorun.inf Won't Work :(



Enigma271828
08-15-2007, 07:18 AM
I downloaded the Portable Apps collection off of portableapps.com and extracted it onto my flash drive. so ... it has a (hidden) autorun.inf file that is supposed to, well.. autorun the executable in PortableApps\PortableAppsMenu\PortableAppsMenu.exe.

In Autorun.inf:


[Autorun]
Open=PortableApps\PortableAppsMenu\PortableAppsMenu.exe
Icon=PortableApps\PortableAppsMenu\PortableAppsMenu.exe
Label=PortableApps

The label works, the icon works, but when i double-click on the drive - it doesn't autorun the program. i would really like it to do that :(

zapjb
08-15-2007, 11:37 AM
What OS?

jf3000
08-15-2007, 04:48 PM
Your icon file is wrong, needs to be a .ico file, this example below works:



[autorun]
Open=Filetoopen.exe
Icon=IconFile.ico
Label=Label Here


Then place the Autorun.inf in the main area of the exe file along with the ico file and your done.

Enigma271828
08-15-2007, 10:05 PM
jf3000 actually my icon works fine with the .exe extension. autorun.inf just reads the icon of the executable.
now i put the executable (PortableAppsMenu.exe) in the root directory, along with my auto run, and change it to
Open=PortableAppsMenu.exe
Without success.

Maybe I need to fix my registry? I do have a registry cleaner :(

jf3000
08-16-2007, 02:38 AM
If a autorun isnt finctioning its usually due to the path or the files missing, hence doesnt load.

game1283
08-19-2007, 12:58 AM
I don't know all kinds of flash drive, but usually some flash drive doesn't allow automated running of files, like what a CD does, so if you put an inf file there, it would run automatically only if you click the autorun, but registry modification can fix it, as well as some other flash now allows them..

lynx
08-19-2007, 10:11 AM
Here's a document which explains what's going on:
http://msdn.microsoft.com/msdnmag/issues/01/11/autoplay/

You need to add the following line: "UseAutoPlay=1"
Also, look at the bit about content sniffing.

Anything deeper than 4 folders deep won't be detected, and consequently won't trigger the autoplay function. One or more playable media files (even a simple bmp or ico file) less than 5 layers deep will cause the autoplay function to take over, rather than the desired autorun.

Btw, it is better to use the ShellExecute command rather than the Open command if the software will crash on Windows 9x, since the ShellExecute command isn't recognised on 9x. It also gives you the opportunity of launching the default application for non-executable files. For example, "Open=anything.html" will be ignored, "ShellExecute=anything.html" will launch the default browser to display the html file.